
In the Dynamics system that I'm working on, there is an entity with a custom form. There is a special field on this custom form. When it contains certain values, the Javascript code that handles the save event for the form cancels the default event with eventArgs.preventDefault() and instead executes a web service call.
That is all fine and well, except for one problem. When the user sets the custom value and clicks [Save & Close], Dynamics shows a warning message in Javascript that the user's changes have not been saved. (You can only imagine how absurd it is to the end-user to click [Save & Close] and see such a warning!)
Apparently, this preventDefault() invocation seems to tell Dynamics not to save the form, which is fine because the form is saved by the web service call, but at the same time, since Dynamics thinks that that form hasn't been saved, it shows a warning message.
My goal here is to make Dynamics stop showing the warning message.
Simply removing the preventDefault() invocation seems to work, but sometimes results in the form being saved twice, which can be problematic and is entirely predictable.
My thought is that since I am invoking preventDefault() but still saving the form using a web service call, Dynamics needs to know not to show the warning message. How do I do thisS?
*This post is locked for comments
I have the same question (0)