You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rescocrm edited this page May 15, 2023
·
9 revisions
Stops the onSave validation and optionally causes an error message to be displayed.
Arguments
Argument
Type
Description
errorMsg
String
An error message to be displayed or "null" to cancel the validation without message.
This example demonstrates how to cancel the validation during the on onSave event.
MobileCRM.UI.EntityForm.onSave(function(entityForm){varaddressDetail=entityForm.getDetailView("Address");varaddrItem=addressDetail.getItemByName("address1_line1");if(!addrItem.value){// use cancelValidation method and set the error message to be displayed// or pass "null" to cancel the validation without any message.entityForm.cancelValidation("Street 1 line is empty.");// Return false to ignore all changesreturnfalse;}},true,null);