Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM Plugins Error - Record Not Created, Already Exists? - Phantom Account Id (Strange behavior)

Posted on by Microsoft Employee

Hi,

In our Account Create Post-operation Synchronous plugin, the following error is thrown:

A record was not created or updated because a duplicate of the current record already exists.


Here's the stack trace:

at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) at Microsoft.Crm.Extensibility.InprocessServiceProxy.CreateCore(Entity entity) at CRMPlugIns.PublicFunctions.CreateRelationshipType(IOrganizationService service, Guid ID, Int32 relationshipTypeValue, String relationshipTypeName, String entityReferenceLogicalName)

Message: A record was not created or updated because a duplicate of the current record already exists.
Trace: [Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin] [01f89f6f-519a-e711-80e2-00155d01e505: ] Starting sync workflow 'Relationship Type - Update Parent Record Modified On - Account & Contact', Id: f6f79f6f-519a-e711-80e2-00155d01e505 Entering ConditionStep1_step: Check if the related entity for the relationship type is Account Entering UpdateStep3_step: Sync workflow 'Relationship Type - Update Parent Record Modified On - Account & Contact' terminated with error 'A record was not created or updated because a duplicate of the current record already exists.' 


Once an account is created, we then create a relationship type for that account (an entity reference to account). When I go to query the database for the account with the particular id (I know the id because we send an error email that includes a serialized string of that entity object), and it does NOT exist in the database. This is a problem we have been facing recently after we rewrote our plugins to use a PluginBase class to handle our services, context, recursive call detection, etc,.

This is very strange. Thank you for taking the time to look at this post.

Cheers!

*This post is locked for comments

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans