Dynamics CRM integration not syncing contacts bi-directional

Your software
My Mautic version is: 2.16.0
My PHP version is: 7.2.24

Your problem
My problem is: The Dynamics CRM integration is not pulling contacts from Dynamics, while companies are being pulled from Dynamics. Pushing contacts works, but it will also create a contact when a contact with the same email already exists in Dynamics.

These errors are showing in the log: No errors are shown, it just doenst see new contacts in Dynamics and says there are none. If I map the Contact ID field to the any of the Dynamics contact fields, it produces this error, but that might be unrelated:

[2020-04-14 15:32:19] mautic.ERROR: SCHEMA ERROR: An exception occurred while executing 'SELECT f.alias, f.is_unique_identifer as is_unique, f.type, f.object FROM mtlead_fields f WHERE f.object = 'lead' ORDER BY f.field_order ASC': SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mauticdb.mtlead_fields' doesn't exist [] []

Steps I have tried to fix the problem: Tried a clean install of both Mautic and Dynamics. Tested if the issue was triggered by mismatching base languages (read somewhere they both have to be in English). Tried database upgrades and migrations. No luck so far.

Perhaps this is an obvious question, but have you configured the integration per the documentation here:

https://docs.mautic.org/en/plugins/microsoft-dynamics-crm

and the field mapping part here:

https://docs.mautic.org/en/plugins/plugin-resources/field-mapping

and followed these steps for testing:

https://docs.mautic.org/en/plugins/plugin-resources/testing-integrations

(Genuine question - the docs might need updating if there is missing information)

Haha, there are no bad questions, thanks for the response :slight_smile:

I did follow these instructions. The docs are not really up to date on the Dynamics/Azure Active Directory side. I’d be happy to update them, but I think it’s best if I get it to work first.

can you send a screenshot of what your field mappings look like as defined in the plugin? I’m running 3.x locally and the Dynmics CRM plugin doesn’t even show the tabs for field mappings which is odd.

Mappings only appear after you’ve authenticated correctly. Company mappings only appear when you select the feature to pull companies. It looks like this:

i have the same issue now on february 23

mautic 4.4.6
sql 5.7.41-cll-lve
php 8.0.27

the integration worked one time but not sync all contatcs
after i have cleaned the database (removed anonymous contacts and optimized database)

the integration works without error but show

contacts send 0 updated, 0 created, 0 with error and 0 ignored

(i have deleted duplicated contact from powerapps table editor on 365 platform)

1 Like

Hey! I am having the same issue with contacts. I can get companies to sync, but never contacts. Is there any information I can provide to help troubleshoot or resolve the issue?

@dcmax Let me know if you have any success pulling from CRM and I’ll do the same.

Update:
I am able to push contacts to CRM, but get warnings when I do so. The records do sync successfully.

Hi, I’m also very deep into trying to solve Dynamics errors. Are you on Slack? Can you hit me up?
You can find me there as Joey Keller.
Once we figure this out we can post the results.

I sent you a DM in the Mautic Slack instance.
Talk with you soon.

Great, if anyone else has issues with the MS Dynamics and Mautic, here is a group we created, hopefully we can solve it.
#dynamics-errors on Slack.