Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Duplicate record

Posted on by Microsoft Employee

Hello ,

I'am getting the following error when opening in entity.

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Cannot insert duplicate key.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220937</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Cannot insert duplicate key.</Message>
<Timestamp>2017-11-21T15:41:34.6988216Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.GlobalActiveStagePlugin]
[bb48066e-f22f-412f-a530-91f72e4b859b: GlobalActiveStagePlugin]


</TraceText>
</OrganizationServiceFault>

Dynamics CRM ONPrem/2015

Thank you in advance

Best Regards,

David

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    So the roblem is that I have a null value in the column stageid ,which is a UI.

    I just have to update the column.

    Thank you for your help.

    Best Regards,

    David

  • Mahesh Variance Profile Picture
    Mahesh Variance 65 on at
    RE: Duplicate record

    Hi David,

    Thanks for your prompt response.

    I am appropriate.

    Thanks

    Mahesh

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    Hello Mahesh ,

    I just found the resolution & the source of the problem,thank you for your invitation.

    Best Regards,

    David

  • Mahesh Variance Profile Picture
    Mahesh Variance 65 on at
    RE: Duplicate record

    Hello David,

    As i review and my expertise seems i am able to fix the issue.

    If you dont could you share with me TV access on private chat ? when we finish this problem you need to recommend me here.

    Let me know if is that work or not

    Thanks 

    Mahesh

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    Further investigation reveals that there is a problem with the BPF.

    System.Data.SqlClient.SqlException (0x80131904): Can not insert a duplicate key row in the "dbo.BusinessProcessFlowInstanceBase" object with a unique index "cndx_Entity1_ProcessId". Duplicate key value: (b37bbcc7-2037-43b1-ad2f-3c218dc19c73, cf855bd1-64a7-e711-80c7-005056a03246, 1088).

    I   did a workaround by creating a new copy of the existing BPF and desactivating the old one.

    but still dont have an explanation for the issues.

    Any suggestions?

    Best Regards,

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    Hi Hassan Ali ,

    I did not see any alternate KEY defined.

                                   AlternateKey.PNG

    BesT Regards,

    David

  • Suggested answer
    Mir Hassan Ali Profile Picture
    Mir Hassan Ali 1,720 on at
    RE: Duplicate record

    Hi David

    Have you defined an alternate key for your entity. Seems like the BPF or a plugin is trying to update the record with an alternate key that already exists.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    Yes, when i desactivate it i can save the record.

    But once activated ,i got the problem.

    Any idea?

    Best Regards,

    David

  • Verified answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Duplicate record

    Do you hv BPF in this entity?? If so check that is also

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Duplicate record

    I forgot to mention that i have the error with only one record,others are fine.

    Best Regards,

    David

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans