By Nikhil Rajendran | Reading time 6 minutes

Data Management: Audit Management and Cleanup

In continuation of our previous post about data management (Cleaning up Data in Microsoft Dynamics CRM), let us look at audit history – one of the largest data generators in any Microsoft Dynamics CRM instance.


Audit history is used to track changes to any records. A typical database row of audit data will provide information about the user who has changed the record, the previous value, and the new value.


For example, if I have changed the phone number of an account, the audit history will look like the following:

Data Management, Audit Management and Cleanup - AhaApps

Audit history is important when dealing with important fields in important entities. For example, in some organizations e-Commerce flows through their CRM instance. It would be vital to save any changes to the fields involved in the transactions.

15 Questions to Identify the Gaps in Your CRM Processes

CRM Checklist - AhaApps
With that being said, it is also important to determine the extraneous entities and fields. It is the best practice to disable auditing in the extraneous entities and fields and enable auditing only for the entities and fields which need to be truly audited.

Let’s look at a few best practices in audit management.

Disabling audit logging at the entity level

In some instances, you might determine that an entire entity and its fields need not be audited. In those cases, you can disable the auditing at the entity level. To do that, please do the following:


  • Go to Settings -> Customizations -> Customize the System
  • Click on the small triangle next to entities
  • Click on the entity name which needs to be disabled
  • Remove the checkbox in auditing (see image below)
  • Click on the Save Icon
  • Click on Publish
Microsoft Wave 2 Dynamics 365 & ERP - AhaApps

NOTE: The above tasks can be done and recommended only to be done by users having the System Administrator and System Customizer security role.

Disabling audit logging at the field level

In some instances, you might determine that a few fields need to be audited and a few fields need not be audited. In this case, please do the following:


  • Go to Settings -> Customizations -> Customize the System
  • Click on the small triangle next to entities
  • Click on the entity name which needs to be disabled
  • Enable the checkbox in auditing
  • Click on Fields(see image below)
Dynamics 365 Audit Management - AhaApps
  • Find the field for which the auditing needs to be disabled. Double click on it.
  • Click on Enable/Disable on the radio button for auditing based on your needs. Click on Save and Close
Dynamics 365 Data Management - AhaApps
  • Click on Publish All Customizations at the top

Cleanup of old audit history

If a CRM organization is a few years old, many organizations can delete the old audit history and keep the history only for the last couple of years. It is good practice to delete the logs which are no longer needed. However, the decision to delete old audit history needs to be consulted with all stakeholders. Some stakeholders might not be comfortable with the deletion of old audit history.


For example, it is understandable if an organization does not want to delete its entire audit history which is over a couple of years old when there is E-Commerce flowing through their CRM organization. Therefore, it is important that the IT department of the organization consults with other stakeholders before making the decision of deleting audit history.


If the decision has been made to delete the audit history, do the following:


  • Go to Settings-> Auditing(Found under system tab)
  • Click on Audit Log Management
  • Select the rows organized by time frame which needs to be deleted
  • Click on Delete Logs
Dynamics 365 Audit Log Management - AhaApps

NOTE: The above method will delete all audit history of all entities within the time frame selected. We do not have the ability to delete the audit history of only certain entities within a certain time frame through the out-of-the-box methods.


Connect with us as we help you acquire actionable intelligence and use data analytics for competitive and best solutions for your enterprise.

Author’s bio:

Nikhil has been with AhaApps since 2017 as a Microsoft Dynamics CRM Developer. He is a driven CRM expert who is ready to fight off the challenges in the Dynamics world with his technical know-how and prowess. He is a sports enthusiast and loves to play tennis when he gets time. He is also a voracious reader and enjoys reading philosophical books.

Updating JavaScript code in Dynamics CRM Made Easy for Developers

To update the existing Web Resources Java code, you don’t necessarily need to start from scratch. Our blog takes a look at this.