I configured a simple workflow which checks if parent account field is filled and throws an error when it is not.
But the workflow shows the following error instead:
Stack Trace:
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: To move to next sales stage, Customer Account is required.
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
Hi,
that's because you stop the workflow with Canceled status, so you get the error box.
try to stop it with Success, and you wouldn't get the error.
in my opinion , in Canceled status write a descriptive message, so the error will be readable, but for sure its all about your business and what you and your client want.