CRM 365 OnPremise.
I have an Accounts.js
that contains the following code simplified for the example:
Xrm.Page.data.save().then(
function() {
Xrm.Utility.alertDialog("Record saved");
},
function(error) {
Xrm.Utility.alertDialog(error.message);
});
The idea is that the form saves, then when the async save is complete it triggers the alert dialog to say 'record saved'.
The problem is that the error function is being triggered, but the error is simply 'serviceIsBusy'.
Can anyone explain how to get around this or what the problem is?
Sadly the official way does not work for OnPremise CRM 365. I have absolutely no idea why and even less time to troubleshoot.
The solution i found somewhere on stack overflow was this 'old' way:
//trigger form save and wait 1 sec
Xrm.Page.data.entity.save();
setTimeout(function () {
saveAccountOK(context);
}, 3000);