Thursday, January 17, 2019

Dynamics 365 CE OnPrem: Enable Language: Violation of PRIMARY KEY constraint 'cndx_PrimaryKey_Report'. Cannot insert duplicate key in object 'dbo.ReportBase'


I have experienced an issue (Duplicate Record) while enabling language in Dynamics 365 Customer Engagement V9 OnPrem Organization (Vanilla).





The Log file showed error Violation of PRIMARY KEY constraint 'cndx_PrimaryKey_Report'. Cannot insert duplicate key in object 'dbo.ReportBase'
Error msg:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Cannot insert duplicate key exception when executing non-query: System.Data.SqlClient.SqlCommand Exception: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'cndx_PrimaryKey_Report'. Cannot insert duplicate key in object 'dbo.ReportBase'. The duplicate key value is (5c4369e7-3c1a-e911-b800-00155d43e6ac, 0, Jan 17 2019 9:47AM).

I tried find the solution into Dynamics community; I identified that its being causing by known issues in Dynamics 365 CE V 9.0.2.3034 and will be resolved in upcoming Microsoft release. 

After digging further into forum details i found a resolution in CRM Patch "CRM9.0-Server-KB4458112-ENU-Amd64", (not officially announced yet). 

https://community.dynamics.com/crm/f/117/t/300064?pi61802=4#responses


After applying the KB4458112 (V 9.0.2.3041), I was able to enable the language and it worked fine. 

I will recommend to install the patch on Dev/Test Dynamics 365 Onprem instance before the production deployment. 

Thumbs up if it works for you. 

Happy Dynamics 365 CE!!!!

Cheers, 
Adnan

1 comment:

  1. Thank you very much for sharing this. I was facing the same issue and was not able to get any solution.
    thumbs up for you for posting the solution

    ReplyDelete