Microsoft Dynamics provides you a feature to see if any record is altered in any way. It also allows you to see what change has happened related to that account such as any field value is changed or status of record has changed, etc.
This feature is termed as Audit History. You can get Audit History of any record from any entity by using the following Web API very easily:
<your-organization-url>/api/data/v9.0/RetrieveRecordChangeHistory(Target=@p1,PagingInfo=@p2)?@p1={'@odata.id':'<plural-entity-logical-name>(<recordid>)'}&@p2={'Count':10,'PageNumber':1,'ReturnTotalRecordCount':true}
For Example:
https://xrmlabs1.crm8.dynamics.com/api/data/v9.0/RetrieveRecordChangeHistory(Target=@p1,PagingInfo=@p2)?@p1={'@odata.id':'contacts(7a97b528-d3ca-e811-a96d-000d3af254d2)'}&@p2={'Count':10,'PageNumber':1,'ReturnTotalRecordCount':true}
You can just paste the above Web API to your web browser and it will return the Old value and changed New value for the record. It also provides you some more information such as who altered the records as well as what operation has performed, etc.
It should look something like this:
Formatted JSON:
{ "@odata.context":"https://xrmlabs1.crm8.dynamics.com/api/data/v9.0/$metadata#Microsoft.Dynamics.CRM.RetrieveRecordChangeHistoryResponse",
"AuditDetailCollection":{
{ "@odata.type":"#Microsoft.Dynamics.CRM.AttributeAuditDetail",
"InvalidNewValueAttributes":[
"LocLabelLanguageCode":0,
"@odata.type":"#Microsoft.Dynamics.CRM.contact",
"preferredcontactmethodcode":1,
"address1_country":"France",
"address1_composite":"39, quai du Roosevelt\r\n92130 Paris\r\nFrance"
"@odata.type":"#Microsoft.Dynamics.CRM.contact",
"address1_city":"London",
"mobilephone":"777-4444-442",
"jobtitle":"Owner of the Firm",
"preferredcontactmethodcode":3,
"address1_country":"United Kingdom",
"address1_composite":"39, quai du Roosevelt\r\nLondon\r\n92130\r\nUnited Kingdom"
"@odata.type":"#Microsoft.Dynamics.CRM.audit",
"_objectid_value":"00000000-0000-0000-0000-000000000000",
"_userid_value":"54933acf-9442-eb11-bb23-000d3a0a82ca",
"auditid":"a6f94183-ee5a-eb11-a607-501ac515b450",
"objecttypecode":"organization",
"createdon":"2021-01-20T07:10:02Z"
In the above example, the Old Value and New Value keys store the old values and new values for the fields respectively. Also, there is a _userid_value which gives you the id of the user who altered the record.
NOTE: To make this functionality work, you must enable auditing for your organization as well as for your Entity.
Enable Auditing for Organization
To enable auditing for your organization, follow the given steps:
-
- Navigate to Advanced Settings > Auditing.
-
- Click Global Audit Settings.
Enable Auditing for Entity
To enable auditing for your entity, follow the given steps:
-
- Navigate to Advanced Settings > Customizations > Customize the System.
-
- Select the entity for which you want to enable auditing.