web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

CRM 2011 – Form is always dirty – Check fields.

Alessandro Graps Profile Picture Alessandro Graps 2,664

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

This was originally posted here.

Comments

*This post is locked for comments