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