CRM Integration error logging AE073


General description #

It is not a self-functional extension, but an auxiliary extension to support custom CRM integration (e.g. CRM integration of sales orders). To use this functionality, this extension needs to be put into dependencies in the extension in which we want to use it.

Extension features allow developers to add:

  • Error logging including call stack
  • Successful synchronization logging
  • Acquisition of the last integration record sync error message
  • Send an email notification about an error

Procedures #

All the procedures are available in codeunit 79100 "ART AA CRM Int. Err. Log Mgt."

  • GetLastError(TableID: Integer; CRMSourceGuid: Guid): Text[1024]
    • Text error value for specific integration record
    • parameters:
      • TableID - ID BC table, in which an integration record is inserted
      • CRMSourceGuid – integration record Guid
  • LogSuccess(CRMRecordVariant: Variant; [RecordName: Text])
    • Creates a log record with successful synchronization status
    • parameters:
      • CRMRecordVariant - Sourse CRM record
      • RecordName – own record name
  • LogError(CRMRecordVariant: Variant; RecordName: Text)
    • Creates a log record with a bad synchronization status containing error text and call stack
    • parameters:
      • CRMRecordVariant - Source CRM record
      • RecordName – own record name

Setup #

Notification e-mail sending #

Sending is done by 79095 Send CRM error notifications report. In the report dialog box, you set up notification e-mail recipients who are separated by a semicolon. The report goes through all log records with an error synchronization status for which was not yet sent a notification email. It is recommended that you add the report as a job queue item that will periodically send notifications within a set time interval.

Sending CRM errors via E-mail #

A CRM Error Email field has been added to the Microsoft Dynamics 365 for Sales Connection Settings page, which specifies to which email a summary of CRM synchronization errors will be sent. Has been added report 80004 Send list of CRM synchronization errors that can be scheduled via the job queue.