2
votes

I checked an entity in the CRM SQL database but there wasn't a column specifying about audit history. I know there is a way to enable / disable it through CRM's online portal but that would take a pretty long time to see which entities have it enabled and which have it disabled.

I've tried poking around but couldn't find much on the topic so I figured I'd see if anyone here knew anything about it or had any experience with it.

Here is a quote from Microsoft's page on accessing it through the online portal:

Click the entity for which you want to start or stop auditing. To start auditing, on the General tab, in the Data Services section, select the Auditing check box. To stop auditing, clear the check box.

http://crmbook.powerobjects.com/basics/data-management-in-microsoft-dynamics-crm/auditing-in-microsoft-dynamics-crm/

Let me know if there is anything I can add to make my question more clear.

3

3 Answers

3
votes

Referring you once again to the XrmToolbox.... The MetaData Browser does what you're looking for:

Metadata Browser Example

Please note that for this screenshot I used the Columns button to move the IsAuditEnabled column as far to the left as possible.

And since you indicated that you have access to SQL, here's a query:

SELECT EntityId, Name, IsAudited
FROM MyOrg_MSCRM.MetadataSchema.Entity

If you're looking to do this in C#, the RetrieveAllEntitiesRequest class is a good starting point.

1
votes

Download XrmToolBox & enable/disable audit in single stretch.

Audit center plugin will help you to complete the magic.

Read more

Update: After you install the xrmtoolbox, Connect to Org, Click 'Audit center', Click 'Load data' - Audited entities & attributes will be listed:

Tool snip

0
votes

Use XRMToolbox tool called SQL 4 CDS and use the below query to get all the entities and attributes where Audit is enabled. You can copy the data to excelsheet and off you go. Good Luck.

  SELECT attribute.displayname AS "Attribute Display Name",
       attribute.logicalname AS "Attribute Logical Name",
       entity.displayname AS 'Entity Display Name',
       attribute.entitylogicalname AS "Entity Logical Name"
FROM   attribute
       INNER JOIN
       entity
       ON attribute.entitylogicalname = entity.logicalname
WHERE  attribute.isauditenabled = 1
and entity.isauditenabled =1;