Data Audit in CRM 2011 (while updating record programmatically)

Suppose we have enabled (out of the box) data audit feature for a particular entity and then we are updating its record programmatically in the following manner (the way we usually do)

myEntityRecord.new_addressname = txtAddressName.Text;

myEntityRecord.new_street2 = txtStreet2.Text;

myEntityRecord.new_city = txtCity.Text;

myEntityRecord.new_state = txtState.Text;

myEntityRecord.new_zip = txtZipCode.Text;

service.Update(serviceMember);

Now what happens over here is that all of these fields will appear as “changed field” in Audit History even if we haven’t changed its value.

Here in the above screen shot we can see the same value for fields in old value and new value column. This is something we should be aware of while updating records programmatically in CRM.

Bye.


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s