Tuesday, August 07, 2012 7:12 PM
I created a sales pipeline workflow as per the following article: http://www.pedroinnecco.com/2012/06/dynamics-crm-workflows-revisited/
I've managed to make this workflow work before without any issues. However I have just deployed it for another client and somehow, sometimes the workflow fails because it detected an infinite loop.
In simple terms here is what the workflow does:
- It is called when an opportunity is created
- It waits for the Pipeline phase to move forward; or
- for the pipeline phase to move backwards, which will call another instance of the workflow and stops the current one (effectively restarting it); or
- for the opportunity to be closed (either lost or own), which will call the post mortem workflow and stop the current one.
The error log I get is the following:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> <ErrorCode>-2147204734</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.</Message> <Timestamp>2012-08-07T15:35:57.5952789Z</Timestamp> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </OrganizationServiceFault> at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.RetrieveMultiple(QueryBase query, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) at Microsoft.Crm.Extensibility.InprocessServiceProxy.RetrieveMultipleCore(QueryBase query) at Microsoft.Crm.Workflow.WorkflowContextBase.get_EntityDependencies() at Microsoft.Crm.Workflow.WorkflowContextBase.RetrieveEntityInstances() at Microsoft.Crm.Workflow.ActivityHost.StartWorkflowExecution(Activity workflow, ICommonWorkflowContext context) at Microsoft.Crm.Workflow.ActivityHostBase.StartWorkflow(ICommonWorkflowContext context, Activity preLoadedActivity)
I wonder if there is any way to solve this issue? I heard about the depth of workflow if it is called 8 times but this is far from being the case here.
Tuesday, August 07, 2012 8:17 PM
It will be helpful if you can do more testing and get to the precise sequence of user actions which lead to wokflow failure.
See if this helps. I have a feeling that this is the piece which causes the failure.
"for the pipeline phase to move backwards, which will call another instance of the workflow and stops the current one (effectively restarting it);"
Tuesday, August 07, 2012 8:20 PM
Actually I think there is something wrong with this workflow (like a bug).
The problem is happening when I chose to move from one stage to another (moving forward). The workflow seems to be restarting and doing quite a mess. I might need to re-do the workflow from scratch.
I've made this workflow work before without any issues.