Your changes have not been saved – Dynamics CRM

Sometimes the error “Your changes have not been saved CRM” appears in CRM when you try to refresh a form using JavaScript and the form is dirty or haven’t finished saving the changes. Hence, we need to validate whether the form is ready for the update. Find below a way to do this validation:

var IsDirty = Xrm.Page.data.entity.getIsDirty();
if (IsDirty )
{
Xrm.Page.data.save().then(function () {
Xrm.Page.data.refresh();
}, null);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s