With CRM 2011, whenever you want to automatically refresh or save a form that has supposedly not been modified by a user, and still get that annoying “Are you sure you want to leave” message, you can sometimes start getting a bit upset about it. Xrm.Page.data.entity.getIsDirty() always returns true.
I need to find the fields that are dirty. I put the following code on FormLoad method :
attribute[] attributes = XrmWrapper.Page.data.entity.attributes.get();
foreach (attribute i in attributes)
{
if (i.getIsDirty())
{
Script.Alert("attribute dirty: " + i.getName());
}
}
In this way I have the name of all attributes on the form that they are in Dirty status.
Archiviato in:Microsoft Dynamics Crm Tagged: CRM, javascript, Microsoft Dynamics CRM

Like
Report
*This post is locked for comments