I had to write some validation code on the OnSave event of the form and if the validation code was not successful I needed to cancel the save. To accomplish this you have to use JavaScript and you need to pass context to your javascript function.
If your business logic fails you need to call this function.
ExecutionObj.getEventArgs().preventDefault();
Where ExecutionObj is the first parameter of the function (i.e. context object).
Cheers
If your business logic fails you need to call this function.
ExecutionObj.getEventArgs().preventDefault();
Where ExecutionObj is the first parameter of the function (i.e. context object).
Cheers
little confused.. what should be replaced with ExecutionObj????? plz provide few examples..
ReplyDeleteExecutionObj is the context object. So when you add your function on the form tick the box that say pass context as the first argument.
DeleteNow that means that the first parameter in your javascript function is the context object and you can cancel your save event from there.