Skip to main content

Notifications

Announcements

No record found.

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

Dataverse Integration Error - Product

(0) ShareShare
ReportReport
Posted on by 1,120
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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans