Connector for Dynamics Crashing When Trying to Open a Map

I was recently trying to use the Connector for Dynamics, which is a tool provided by Microsoft to provide a way to integration the various Dynamics software products. In my situation, I was trying to integrate Dynamics CRM to Dynamics AX 2012 R3.

After installing the Connector and configuring the AX and CRM adapters, I began trying to activate the maps in the recommended order which is (taken from the Connector setup guide):

  1. Map enumerated values
  2. Map employees and ERP system users
  3. Map unit schedules and unit groups
  4. Map currency information
  5. Map items and products
  6. Map customers and accounts
  7. Map contact information
  8. Map sales orders
  9. Map sales invoices

Steps 1-4 ran successfully. However, when I would try to open (not yet run) the map for step 5, the Windows service that sits behind the Connector client would stop responding and crash which would cause the client to shut down.

I tried every debugging process I could think of.

  • Turning on verbose logging for both the client and the service.
  • Examining the resulting entries in the server’s Event log.
  • Attaching WinDBG to the Windows service process and examining the output when recreating the error.
  • Running Fiddler to see if the crash was the result of an error in the network traffic (i.e. the CRM adapter had a problem).
  • Scouring the internet, blogs and Dynamics forums for AX and CRM
    • I even posted to the CRM and AX community forms, but had no answers or even responses.

At a complete standstill, I had to choice to open a MS Support ticket. The engineer mentioned that the Connector does not support self-referencing relationships on CRM entities. In our CRM instance, a self-referencing 1:N relationship on the Product entity.

After performing some testing, against an OOTB/un-customized CRM organization, I found that this was indeed the problem that was causing the Connector’s Windows Service to crash. Basically, the self-referencing relationship was causing the Connector to become stuck in an infinite loop which, in turn, caused a stack-overflow and the subsequent crash.

The recommended course of action was to remove the relationship and it’s related fields. However, due to circumstances beyond my control, I wasn’t able to do that.

I asked if the Microsoft team responsible for the Connector would consider updating the Connector to support a self-referencing relationship. After all, it’s a supported customization in CRM. The reply was since the Connector is deprecated (no longer supported after CRM 2016; versions 8.0 and 8.1), the requested change wasn’t going to happen. (There is a new integration tool being released for Dynamics 365 (version 8.2)).

In the end, I was able to find a solution on my own. I found the XML files that contained the meta-data defining the CRM entities which had been configured in the Connector for integration between AX and CRM. These XML files are located on the server where the Connector is installed: C:\Program Files (x86)\Microsoft Dynamics\Microsoft Dynamics Adapter\Adapters\Microsoft.Dynamics.Integration.Adapters.Crm2011\ObjectConfig\(yourCRMOrgName).

I had to remove two lines from the “ProductObjectProvider” file: the line referencing the relationship and the line referencing the field related to the relationship. Once the XML file was edited, I was able to open the Items to Products map in the Connector and run it as needed.

While this solution works and allows you to get around the deficiency in the Connector, there are some caveats to the solution.

  • Any time you connect the Connector to a new CRM organization (i.e. deploy the integration to test or production), you’ll have to remember to manually edit the XML file.
  • Any time you reconfigure the CRM adapter within the Connector, you’ll need to edit the XML file again.
Dynamics CRM