CRM 2011 Checking for changed fields in a form

Sometimes, when trying to close a form down in Dynamics, or trying to print preview, you will often get the following message.


This will nearly always mean that when the form has loaded, some of the attributes have actually changed, so Dynamics detects that the form is not up to date, and requires a save before proceeding.

This can sometimes be tricky to work out what has changed, so below is a useful little trick.

In Internet Explorer, hit the F12 key when the form is displayed, and select the script tag.  Copy and paste the following code in to the script input area and run it.  This should then print out the name of all of your “Dirty” fields.

var listOfAttributes = frames[0].Xrm.Page.getAttribute();
for(var attrib in listOfAttributes){
   var currentAttrib = listOfAttributes[attrib];
   if (currentAttrib.getIsDirty && currentAttrib.getIsDirty()){

CRM 2011 Web Resource Linker / Publisher

This is an excellent utility for visual studio 2012 (and 2010 with a bit of tinkering) that allows you to publish JavaScript and other web resources straight from Visual Studio. It’s a huge time saver and seems to be pretty reliable. It’s an essential part of my workflow now.

Depending on the version of Visual Studio you use, all you need to do is edit the WebResourceLinker.AddIn file, and change the Version element of the XML to one of the following :

Visual Studio 2010


Visual Studio 2012


Visual Studio 2013


After that, just copy the contents to your Visual Studio 201x\Addins folder for it to work.

You may also need to manualy unblock each DLL in the addin folder as well to get it to work.

Entity Documentation Generator

A useful utility that should always be used to document your entities when developing them is the Metadata Document Generator.  With this, you can point it at your Dynamics Install and have it produce documents outlining your custom entities, and their fields and relationships.  This is always useful to have on hand when developing, or reporting on your data.