Friday, October 12, 2018

Dynamics CRM - What happens to the audit log when field gets deleted?

If you delete a field from a CRM entity, the complete column gets dropped from the database table. This is a known fact and should be mentioned explicitly in your design/userstory to avoid confusion later. The question is, what happens to the audit log itself?

I was doing some testing on 8.1.0 OnPremise and the good thing is, Microsoft is handlign this quite nice (i am not sure if this was the case from the beginning of the audit log).

I created a field "Bank Secret" in the account entity with auditing enabled, created a new account and afterwards deleted the field from form and entity again.


Result

  • The audit-entry still exists
  • the field name is flagged with a id and a "[deleted]" marker
  • The value is removed and shows the famous "audit" icon

Cheers

Thursday, September 6, 2018

Dynamics CRM - Possible values for TraceLogBase.ErrorTypeDisplay

In my current project we are cleaning up the TraceLogBase table to reduce the DB size and overall get rid of unnecessary data.

Since the documentation on MSDN is not very helpful to understand/make sure what exactly is traced in the table (only email related or other things as well), I extracted the current entries of a ~3 years old database and grouped them by "ErrorTypeDisplay". Following values I identified.

Note: Maybe not complete!
  • ExchangeSyncACTDeliveryMethodNotExchangeSynchronization
  • ExchangeSyncUnapprovedEmailAddress
  • IncomingDeliveryMethodNotEmailRouter
  • IncomingEmailRejected
  • IncomingEmailServerServiceError
  • IncomingMailboxTimeoutError
  • IncomingServerCertificateError
  • IncomingTestConfigurationSuccess
  • InvalidIncomingEmailServerProfile
  • InvalidIncomingMailboxCredentials
  • InvalidIncomingMailboxEmailAddress
  • InvalidOutgoingEmailServerProfile
  • InvalidOutgoingMailboxCredentials
  • InvalidRecipientEmailAddress
  • MailboxQuotaExceeded
  • OutgoingDeliveryMethodNotEmailRouter
  • OutgoingEmailServerServiceError
  • OutgoingMailboxSendAsPermission
  • OutgoingServerCertificateError
  • OutgoingTestConfigurationSuccess
  • RetrieveAttachmentFailure
  • UnapprovedIncomingEmailAddress
  • UnapprovedOutgoingEmailAddress

Query which also returns the amount of traces

Use
SELECT ErrorTypeDisplay, Count(*) AS 'Number of Traces'
FROM
GROUP BY ErrorTypeDisplay
ORDER BY ErrorTypeDisplay
Cheers