Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

CRM 2013 - OnSave code not cancelling the save

$
0
0

I have a function which runs OnSave of a form, if certain criteria are met it will cancel the Save by using this command, this command does run and the alert returns 'true' but the record still saves.

This is only set to run when the getSaveMode is 5, so when I hit Deactivate it runs the code, alerts me as per below but still deactivates the record. How do you stop it deactivating the record? the code below doesn't seem to work.

Thanks

            prmContext.getEventArgs().preventDefault();
            alert("default prevented = " + prmContext.getEventArgs().isDefaultPrevented());


Pete



Viewing all articles
Browse latest Browse all 8223

Trending Articles