Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Getting Execution Context for JavaScript OnSave Event

$
0
0

I am working on a javascript function to provide duplicate detection. I want to prompt the user that there may be a duplicate and provide the option to cancel saving/creating the form. I am encountering a problem canceling the save event. I am attempting to use the execObj.getEventArgs().preventDefault() function but I can't seem to get the execution object to be anything other then null even though I have checked the box to pass the execution context as the first parameter. Here is what I have so far:

_onSave: function (executionContext) {
            Xrm.Utility.confirmDialog("A similar record in case# 6572-2 has been detected. Are you sure you want to create this case?", null,
                function (executionContext)
                {
                    executionContext.getEventArgs().preventDefault();
                })
        }



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images