Skip to main content

Notifications

Microsoft Dynamics CRM forum
Suggested answer

An unexpected error occurred from ISV code.

Posted on by

I configured a simple workflow which checks if parent account field is filled and throws an error when it is not.

pastedimage1625101524848v2.png

But the workflow shows the following error instead:

pastedimage1625101396904v1.png

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

Categories:
  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: An unexpected error occurred from ISV code.

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans