Export (0) Print
Expand All

Xrm.Page.data (client-side reference)

Applies To: CRM 2015 on-prem, CRM Online

Xrm.Page.data provides methods to work with the form. You can refresh the data in the form and save the form asynchronously.

refresh
Asynchronously refreshes and optionally saves all the data of the form without reloading the page.

save
Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.

Asynchronously refreshes and optionally saves all the data of the form without reloading the page.

Xrm.Page.data.refresh(save).then(successCallback, errorCallback);
Parameters
save
A Boolean value to indicate if data should be saved after it is refreshed.

successCallback
A function to call when the operation succeeds.

errorCallback
A function to call when the operation fails.

The errorCallback will be passed an object with the following properties:

errorCode
Type: Number. The error code.

message
Type: String. A localized error message.

Remarks
This method is only available for Updated Entities.

Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.

Xrm.Page.data.save().then(successCallback, errorCallback)
Parameters
The successCallback and errorCallback functions are executed depending on whether an error is returned.

The successCallback will not have any arguments passed to it. It will simply be called if the operation succeeds.

The errorCallback will be passed an object with the following properties:

errorCode
Type: Number. The error code.

message
Type: String. A localized error message.

Remarks
This method is only available for Updated Entities.

Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.
Show:
© 2014 Microsoft