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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

can not insert duplicate key error while creating service task in MS Dynamics 365 version 1612 (9.0.12.4)

(0) ShareShare
ReportReport
Posted on by 10

Dear Support Team,

I got a below error while creating service task in Dynamics 365

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.Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>2d2084ee-44c7-49cb-86c4-a23cd9fe8d53</ActivityId>
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>OperationStatus</d2p1:key>
<d2p1:value xmlns:d4p1="">www.w3.org/.../XMLSchema" i:type="d4p1:string">0</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>SubErrorCode</d2p1:key>
<d2p1:value xmlns:d4p1="">www.w3.org/.../XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Cannot insert duplicate key.</Message>
<Timestamp>2020-02-21T03:42:43.5271868Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>

[Infoman.Crm.ServiceTaskPlugins: Infoman.Crm.ServiceTaskPlugins.PartRequirements.RelationGeneratorPlugin]
[c6f984f0-c11a-e311-9008-00155d204602: Infoman.Crm.ServiceTaskPlugins.PartRequirements.RelationGeneratorPlugin: Create of cu_servicetask]


</TraceText>

Any one help me and provide solution for this?

Best Regards,

Punit

I have the same question (0)
  • mobeenmohsin Profile Picture
    on at

    Hi Punit,

    There are couple of reasons for this exception and this exception is getting generated from customer plugin, please help to review your plugin login or you can un-register that plugin step  and create entity record. Please also help to confirm if you entity has auto number or not.

    if your entity has auto number then you can check the seed value and the following document may help you:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes

    if your entity don't have auto number you can verify if your entity has keys using Setting > Customize the system, under each entity we have keys option where we can define unique keys. Thank you.

    Based on exception, it seems your plugin logic is creating problem while creating record. Please review the plugin logic and try above two options for auto number and unique keys for entity.

    Best Regards,

    Mobeen Mohsin

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans