-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.UI.EntityForm.cancelValidation
rescocrm edited this page May 15, 2023
·
9 revisions
Stops the onSave validation and optionally causes an error message to be displayed.
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) {
var addressDetail = entityForm.getDetailView("Address");
var addrItem = 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 changes
return false;
}
}, true, null);