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
[v8.2] Binds or unbinds the handler for onPostSave event on EntityForm.
Arguments
Argument
Type
Description
handler
function(entityForm)
The handler function that has to be bound or unbound.
bind
Boolean
Determines whether to bind or unbind the handler.
scope
Object
The scope for handler calls.
This example demonstrates how to use Post Save method while the online mode is running. You are able to create children for parent entity while your parent doesn't exist yet.
MobileCRM.UI.EntityForm.onPostSave(function(entityForm){/// register event.varentity=entityForm.entity;varaccount=newMobileCRM.Reference(entity.entityName,entity.id,entity.primaryName);varpostSuspend=entityForm.suspendPostSave();/// create associated contact.varcontact=newMobileCRM.DynamicEntity.createNew("contact");contact.properties.lastname="_child of "+account.primaryName;contact.properties.parentcustomerid=account;contact.save(function(err){if(err)MobileCRM.bridge.alert(err);else{postSuspend.resumePostSave();}});},true,MobileCRM.bridge.alert);