Saturday 3 December 2016

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

1 comment:

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

    ReplyDelete