Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Dataverse Integration Error - Product

Posted on by 1,114
We are attempting to use the out of the box dataverse to connect BC and CRM.  Setup was successful without any issues and we have successfully integrated customers and support tables (such as payment terms).  However, we have not been able to integration the items/products. 
 
We get the following error when attempting to send an item to CRM.
An error occurred when communicating with Dataverse.

Detailed description: Sql error: Statement conflicted with the foreign key constraint. CRM ErrorCode: -2147185375 Sql ErrorCode: -2146232060 Sql Number: 547
 
 
On the flip side, when we attempt to add a product in CRM we get the following error.
 
Exception Message:  Sql error: Statement conflicted with the foreign key constraint. CRM ErrorCode: -2147185375 Sql ErrorCode: -2146232060 Sql Number: 547
ErrorCode: -2147185375
HexErrorCode: 0x80048d21
ErrorDetails: 
    ApiExceptionSourceKey: Plugin/Microsoft.Crm.ObjectModel.CustomBusinessEntityService
    ApiStepKey: ae3b8615-ecd8-db11-b397-0019b9204da9
    ApiDepthKey: 1
    ApiActivityIdKey: 415e7769-be7e-4d77-a3c3-308a8cc59b7d
    ApiPluginSolutionNameKey: System
    ApiStepSolutionNameKey: System
    ApiExceptionCategory: ClientError
    ApiExceptionMessageName: StatementConflictedWithFKConstraint
    ApiExceptionHttpStatusCode: 400
HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80048d21&client=platform
Activity Id: 88e72586-d4da-4ac4-b3ea-72f781a0f97e
 
 
So it seems to be related to an issue with a foreign key constraint, as the error message indicates. Comparing the product entity in production and sandbox, the only difference I can see is the presence of an additional field called bcbi_companyid.

This is a lookup to another entity and qualifies as a foreign key. I wonder if the presence of this field is the cause of the problem. I can delete this field and see if that fixes the problem. In order to delete, I’d have to uninstall a managed solution that was added to the sandbox on 6/6/2023 (see image below). Let me know your thoughts. I’m happy to jump on a call to discuss.


 
Any thoughts on how to resolve?
 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans