You're right, the "Assign" event can generate a significant amount of audit data, especially in environments with frequent record assignments. Here's how you can address both your needs: deleting existing "Assign" event records and disabling future ones from being created:
1. Disabling Future "Assign" Event Auditing:
You can disable auditing for the "Assign" operation at the entity level. Here's how:
- Go to Settings > Customizations > Customize the System.
- Expand Entities.
- Select the Entity for which you want to stop auditing the "Assign" event (e.g., Account, Contact, Case, Opportunity). You'll need to do this for each relevant entity.
- In the Entity definition, look for the "Data Services" section.
- Find the "Auditing" option. If it's not checked, auditing is already disabled for this entity. If it is checked, proceed to the next steps.
- Click on "Auditing" to open the Auditing settings for that entity.
- In the "Entity Level Auditing" section, you'll see a list of attributes and operations that are being audited.
- Locate the "Assign" operation in the list.
- Uncheck the box next to "Assign".
- Click "Publish" All Customizations.
Important Considerations for Disabling Auditing:
- Impact on Compliance: Carefully consider the implications of disabling auditing for the "Assign" event. Your organization might have compliance requirements that necessitate tracking record assignments. Ensure you understand these requirements before making this change.
- Troubleshooting: Audit logs can be valuable for troubleshooting issues and understanding data changes. Disabling auditing for assignments will remove this historical record.
- Entity-Specific: You need to perform these steps for each entity where you want to stop auditing the "Assign" event.
2. Deleting Existing "Assign" Event Records:
Deleting existing audit records can be done through the Dynamics 365 interface, but it's important to understand the implications:
- Go to Settings > Audit Log Management.
- You'll see options to delete audit records based on date ranges. However, there isn't a direct filter within the standard interface to delete only "Assign" events.
Workarounds for Deleting Specific "Assign" Events (More Involved):
- Advanced Find (Limited):
- Go to Advanced Find.
- In the "Look for" dropdown, select Audit Logs.
- You can try to filter by the "Operation" field and select "Assign".
- However, the standard "Delete" functionality in Advanced Find for Audit Logs might be limited or not available for bulk deletion.
- Using the Bulk Data Updater Tool (from XrmToolBox):
- Connect to your Dynamics 365 environment using XrmToolBox.
- Find and open the "Bulk Data Updater" tool.
- Select the Audit Logs entity.
- Use the filtering options to target the "Assign" events based on the "Operation" field and the date range you want to delete.
- Choose the action "Delete Matching Records".
- Exercise extreme caution when using bulk deletion tools. Ensure you have selected the correct records before deleting them, as this action is irreversible. It's highly recommended to perform this in a non-production environment first to verify the results.
- Writing Custom Code (Plugin or Console Application):
- A developer could write custom code using the Dynamics 365 SDK to query and delete audit records based on the "Operation" type ("Assign") and a specific date range.
- This provides the most control but requires development effort and should be thoroughly tested.
Recommendation:
- Disable Future Auditing: The first and most crucial step is to disable future auditing of the "Assign" event for the entities where you don't need this information. This will prevent the audit log from growing unnecessarily.
- Deleting Existing Records:
- For a one-time cleanup, using the Bulk Data Updater tool from XrmToolBox is likely the most feasible option within the standard toolkit, but requires careful filtering and understanding of the tool.
- If you have a large volume of "Assign" events to delete regularly, consider a custom code solution for more automated and controlled deletion.
- Be aware that deleting audit logs can have implications for historical analysis and compliance. Ensure you have the necessary approvals and understand the potential impact before deleting any audit data.
Remember to always test any changes, especially deletion processes, in a non-production (sandbox) environment first.