web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Dataverse Integration Error - Product

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 768 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 541 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 324 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans