I have been looking for a way to get the list of all dirty fields in the CRM form to determine the what was changed and need to be saved in the browser console. This will help me debugging the javascript or other CRM related issues in general
How can i achieve this ?
You can use the following code for your reference
to get the list of all fields in the from and then call the function
getIsDirty()
for it asNow the
filterDirty
will hold an array of all the dirty fields and you can just print it with the map asNote: Just make sure Xrm is available you can see why there is additional bit of code before the what i described above from here
the whole code will look something like this for you
Open the developer tools (F12), select the Console and enter the following:
The returned Xml will list the dirty fields and their values as XML. For example