web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

The Xrm.Page.data.refresh method

Guido Preite Profile Picture Guido Preite 54,086 Moderator
CRM 2013 introduced new client APIs, one is the Xrm.Page.data.refresh method.
The MSDN definition is:
Asynchronously refreshes and optionally saves all the data of the form without reloading the page.

Xrm.Page.data.refresh(save).then(successCallback, errorCallback);
Why we leverage on this method?
The obvious reason is that we want the actual data displayed on the form, the inner reason is due to the Dynamics CRM platform, a record can be updated in several ways including workflows or plugins operating server-side.
Most of the server-side events don't refresh the UI, but with the Xrm.Page.data.refresh method we can manually force the page to display the current values.

If we want a simple refresh we can just write:

Xrm.Page.data.refresh(false);
A small advice will appear during the operation

This was originally posted here.

Comments

*This post is locked for comments