have this scenario which is causing the Depth issue in CRM
I have a Entity (EntityA) which has 3 Boolen flags (A1, A2, A3). There are 3 workflows mapped to the entity (WorkflowA1,WorkflowA2,WorkflowA3)
I have another Entity (EntityB) which has one Boolean Flag (B1). There is 1 workflow attached to this entity (WorkflowB1)
The data is in this mapping. For a record in EntityA there will be multiple records in EntityB (Parent - Child data).
Here is the flow. On Setting of the Flag A1, the WorkflowA1 starts. This workflow (WorkflowA1) just gets the corresponding records in EntityB for the current record of EntityA. After retreving it sets all the B1 flag to True. This gets the WorkflowB1 started on records of EntityB. On completition of WorkflowB1 it would set the flag B1 back to false. In the mean time the WorkflowA1 would monitor the flags to be changed back to false. One all flags are of corresponding records of entityB are false, this concludes the WorkFlowA1. On Completion of WorkFlowA1 it sets the flag A2 to true.
The flag A2 = true kicks up WorkflowA2. After this completes, it sets the flag A3 to true. The flag A3 = true kicks up WorkflowA3. After this completes it indicates the completion of the whole process. The Workflow3 does the heavy work and during this process lot of plugins on other entities fire.
I had a issue where i got the error "Pluginfailed" . On further looking at trace I found out it was complaining about depth.
So I put in some logging. Here is what I found out :
WorkflowA1 : Depth is 1 WorkflowB1 : Depth is 2 WorkflowA2 : Depth is 3 WorkflowA3 : Depth is 3
I am not sure why it is treating the WorkflowA2 as depth 3. I can understand WorkflowB1 running at depth 2.
Because of this and some plugins, my process fails.
I do not have an option to look at the plugin implementation. Is there anything I can do so that at least WorkflowA1,WorkflowA2,WorkflowA3 run at depth 1 only.
Any pointers will help. Please let me know if any additional information is required.
Thanks, Girija Shankar
*This post is locked for comments