Tuesday, 5 May 2015

CRM 2015 - {Javascript Code Example #2} - Save a form asynchronously with call back function

 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:

https://msdn.microsoft.com/en-us/library/dn481607.aspx 

CRM 365 Cloud - Disassociate 2 records using typescript

In case you need to Disassociate 2 records, please find below the code that allows you to do that.      export async function DissociateE...