Get the list of all the dirty fields in the form in Dynamics 365

Hi,

Recently on opening our lead record in CRM we were getting unsaved changes message. We know this is because of the some of Business Rules or JavaScript and it is bit difficult to find the field.

Here is the way to quickly find the list of all field those are dirty.

1) Open the record in CRM.
2) Navigate to Developer Tools.
3) Go to -> Console and paste the below code and press Enter.

var message = “The following fields are dirty: \n”;
frames[0].Xrm.Page.data.entity.attributes.forEach
    (function (attribute, index) {
        if (attribute.getIsDirty() == true) {
            message += “\u2219 “ + attribute.getName() + “\n”;
        }
    });

alert(message);


You will the field schema names in the alert.


Hope this helps.


Happy CRM’ing

Gopinath

One thought on “Get the list of all the dirty fields in the form in Dynamics 365

  1. Unknown December 27, 2016 / 4:52 am

    This is a very helpful. Great Tips !! Keep publishing your content and published new content for good readers. Lead Capture Tool

    Like

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