Have you ever wanted to intercept the Save, Save and Close or Save and New for a record in CRM, in order to first do some validation prior to saving? Using the event.returnValue = false was the method that I traditionally used in JavaScript, yet it’s not supported in Firefox or Chrome.
With the UR12 changes to Microsoft Dynamics CRM 2011, all JavaScript code needs to (or at least should be) cross browser compliant. There’s a method called preventDefault(), which appears that it will successfully accomplish the same thing.
Here’s the detail from MSDN:
preventDefault
Cancels the save operation, but all remaining handlers for the event will still be executed.
ExecutionObj.getEventArgs().preventDefault()