0
votes

Sometimes a have a error between execute async plugin that start on OnChange event. Plugin throw error in Update process. Plugin must update entity that is a Primary entity for this plugin.

Error Message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Data.SqlClient.SqlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5083140DDetail:


-2147220970 System.Data.SqlClient.SqlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5083140D
2016-11-11T09:31:15.2410512Z [Zeppelin.Approval: Zeppelin.Approval.SignStatusUpdated] [7059a33a-804e-e211-b1b9-00155d003b10: Zeppelin.Approval.SignStatusUpdated: Update of ma_sign] at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Update(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) at Microsoft.Crm.Extensibility.InprocessServiceProxy.UpdateCore(Entity entity) at Zeppelin.Approval.Helper.ApprovalService.SetSignDateOnSign(EntityReference sign, Nullable`1 signDate) at Zeppelin.Approval.SignStatusUpdated.Execute(IServiceProvider serviceProvider) at Microsoft.Crm.Asynchronous.V5ProxyPlugin.Execute(IServiceProvider serviceProvider) at Microsoft.Crm.Asynchronous.EventOperation.InvokePlugin(AsyncExecutionContext context, IPlugin pluginInstance)

1
I would start here Zeppelin.Approval.Helper.ApprovalService.SetSignDateOnSign(EntityReference sign, Nullable 1 signDate) at Zeppelin.Approval.SignStatusUpdated.Execute(IServiceProvider serviceProvider) - dynamicallyCRM
you want to read code method? public void SetSignDateOnSign(EntityReference sign, Nullable<DateTime> signDate) {if (sign == null || !signDate.HasValue ) return; Entity updatedSing = new Entity(sign.LogicalName) { Id = sign.Id }; updatedSing["ma_date"] = signDate; _service.Update(updatedSing); } - barsmaga
And how is the plugin registered? On sign entity update? or on a different entity? You might want to check if you are entering a recursive call loop. - dynamicallyCRM
Yes, in plugin I update "sign" entity, but obvious recursive loop not exist. This error throw not permanent, 2-3 problems per mounth. - barsmaga
(plugin finished successed usualy). This plugin register to onchange of "Status reason" attribute, to onchange this attriubute started some other Workflow process (4 items). May be processes set lock in database durring execute to "sign" entity and update process from plugin failed? - barsmaga

1 Answers

0
votes

I talked about this problem with senior developer from my team, and we find it. Async plugin try update a entity, but at this moment workflow try update entity too. We catch this situation in logs for system jobs. Async plugin execute with exception because at this moment workflow update entity and set lock to record on database.