I created a real-time workflow on Friday that was working fine. Very simple one to prevent any changes on a related page to a Work Order after going Closed-Posted or Closed-Canceled. For ease, I also created a field called Work Order Lock that gets set to Yes via a business rule when the Work Order was set to either of the Closed statuses.
The workflow is as below. To summarize: If the Work Order is locked, and a field is changed on the related form, end the process as cancelled with the message: Cannot change data of a Closed Work Order.
As mentioned, it was working fine on Friday 9/11. I came back to the task Monday to finish adding the same workflow to a couple other related forms, only to find I am now receiving this business process error:
The real-time workflow named "Work order Service cancel data changes" failed with the error "Cannot change data of a Closed Work Order"
The comments form the Process Session shows:
Sync workflow failed with error message - Unhandled exception:
Exception type: Microsoft.Xrm.Sdk.InvalidPluginExecutionException
Message:
-- End stack trace --
Exception type: System.Activities.Statements.WorkflowTerminatedException
Message: Cannot change data of a Closed Work Order
at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout)
at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)
at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.ExecuteWorkflowUsingInvoker(Activity workflow, ICommonWorkflowContext context)
at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.StartWorkflow(WorkflowActivationData activationData, ICommonWorkflowContext context)
-- End stack trace --
, error code - -2147220970
I made no changes over the weekend, but do notice that a few updates were pushed out Saturday.
If I change this to a background workflow, it triggers fine and can update fields and end with a canceled state. But, I need to to prevent the data from changing. Therefore the real-time workflow.
I duplicated the behavior on 3 other entities and 2 other environments. Additionally, I created new Real-time workflows that were triggered on the same form, not a related form to rule that out. All environments had the Saturday updates.
Can anyone help figure out what changed and how I can make the needed adjustments to get this working again?
Thank you in advance!