CRM 2015 – {Javascript Code Example #2} – Save a form asynchronously with call back func
If for any reason you need to have a call back function in CRM after saving a form asynchronously it is possible to do with this line below:
Xrm.Page.data.refresh(save).then(successCallback, errorCallback);
More detail please see next table:
Name Type Required Description
save
Boolean
No
true if the data should be saved after it is refreshed, otherwise false .
successCallback
Function
No
A function to call when the operation succeeds.
errorCallback
Function
No
A function to call when the operation fails.
An object with the following properties will be passed:
errorCode : Number . The error code.
message : String . A localized error message.
Src: