Dynamics CRM Form Ajax Update


Microsoft released since CRM 2013 new client APIs, some of them are the Xrm.Page.data.refresh and Xrm.Page.data.save methods.

The refresh method Asynchronously refreshes and optionally saves all the data of the form without reloading the page as per MSDN and has the following signature:

Xrm.Page.data.refresh(save).then(successCallback, errorCallback);

This function has a better user experience than the old form refresh method which reloads the whole form and fires the on-load events that might not be needed.

Also, in the case we wanted to perform asynchronous save of data we can utilize the save function which saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed as per MSDN and has the following signature:

Xrm.Page.data.save(saveOptions).then(successCallback, errorCallback)

Leave a comment