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

  • mobeenmohsin Profile Picture
    on at
    RE: can not insert duplicate key error while creating service task in MS Dynamics 365 version 1612 (9.0.12.4)

    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

#3
Sahra Profile Picture

Sahra 43

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans