MS CRM - What is the "IsDirty" Method ?

Hi,

The "IsDirty()" Method returns a Boolean value indicating if there are unsaved changes to  attributes values.

Code:

//To Check if the entity is dirty
var ismodified=Xrm.Page.data.entity.getIsDirty();

//To Get Dirty Fields
var attributes = Xrm.Page.data.entity.attributes.get() ;
for (var i in attributes)
{
var attribute = attributes[i];
if (attribute.getIsDirty())
alert("attribute dirty: " + attribute.getName());
}

Get All Dirty Fields in a Form In CRM Using Java Script SDK

Hi,

I am gonna show how to get all the dirty fields on a form using java script in Microsoft Dynamics CRM 2011

Note: if you don't know about the dirty fields you can check the following link

http://crmprof.wordpress.com/2013/02/25/ms-crm-2011-what-is-the-isdirty-property/

Code:

// Get Dirty Fields

var attributes = Xrm.Page.data.entity.attributes.get() ;

for (var i in attributes)

{
var attribute = attributes[i];

if (attribute.getIsDirty())

alert("attribute dirty: " + attribute.getName());

}