Dynamics CRM 2016
Which fields are dirty?
Have you ever needed to know which fields are dirty? i.e. which fields have had their values changed and thus need to be saved. Microsoft Dynamics CRM provides you with a few methods you can use to get this information.
Is the page dirty?
This will return true if the page is dirty, false otherwise.
Is an attribute dirty?
which will return true if the field is dirty, false otherwise.
List dirty fields in the debugger
If you are using the integrated debugger (F12 when running IE or Edge) then you can add a watch expression to show you the dirty fields. Simply add the following as a watch expression:
This returns Xml. The outer tags of the xml contains the logical entity name. Any inner elements reflect those fields that are dirty.
These notes have been tested with Microsoft Dynamics CRM 2016, and may apply to other versions as well.
About the author: Brian Cryer is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.