1 |
Xrm.Page.data.save(saveOptions).then(successCallback, errorCallback) |
Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.
With Microsoft Dynamics CRM Online 2015 Update 1 or later you can also set an object to control how appointment, recurring appointment, or service activity records are processed.
Open different or same entity form after save :
1 2 3 4 5 6 7 8 9 |
Xrm.Page.data.save().then( function() { console.log("success"); Xrm.Utility.openEntityForm(entityname,recordId); }, function(errorCode,message) { console.log(message); } ); |
Reload form after save
1 2 3 4 5 6 7 8 9 |
Xrm.Page.data.save().then( function() { //save worked... Xrm.Page.data.refresh(); }, function() { console.log("save failed"); } ); |
window.location.reload(true); or location.reload(); or window.location = document.url;
These scripts cannot work for CRM 2013 and higher version. So you have to use callback functions after saving.
Source : https://msdn.microsoft.com/en-us/library/dn481607.aspx