Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Sync workflow failed with error message

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello there. In our system we have some workflow, that should be synchronious (with starting by user). When user start such workflow, he can get an error message, signalized, that some condition for record was failed (like an error message).

But in the same time this workflows can be started for a list of records. In that way, if some condition failed for some record, we have record in processsession table with some information, including reasone of failure (this is about what we get from comment), but information in that column is a little bit unreadable for single user.

So, what I want: Is there a convinient way to parse this comment, so it could be like friendly, readable message (like when when user start workflow for single record and got workflow step error).

For example, we have this in comment from processsession:

Sync workflow failed with error message - Unhandled Exception: System.Activities.Statements.WorkflowTerminatedException: Process should be started from active Opportunity
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)
Inner Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException, error code - -2147220970

And I want to have only this: "Process should be started from active Opportunity"

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sync workflow failed with error message

    Well, something tells me, that i will do it by myself (don't want TT.TT)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sync workflow failed with error message

    Well, definitly this i do in my workflow, like on ur screenshot

    processsession.PNG

    When user start workflow, he can get exception with message about such case. All cases already recorded in workflow steps. And all works great, when user start workflow for single record (for examle for single opportunity).

    But when user do it for list of records, he couldn't see possible errors for this list, that can be occured by some case, that mentioned in workflowstep (for example: if workflow canceled). Nevertheless all such falls have been writen in crm table, called processsession, and messeges, that user usally see in error messege window, put in column, named, comments (like on scrinshot):

    processsession.PNG

    So, i can get this information, and even get error (reasone of workflow failed). The only thing i should do - is to parse this to normal readable view (like message in error message window). That's why i asked - is there any convinient parser for this/

  • Suggested answer
    Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: Sync workflow failed with error message

    The error message you refer to is from deep inside the internals of Dynamics 365 so it's not going to be possible to customise and change it.

    And while it's not possible to edit the message I also don't think it would be the correct approach even if you could. What you should be doing is identifying what the actual errors are and handling the known ones you don't care about at the top of the workflow by catching the possible cases and stopping the workflow before it creates the error.

    7266.Screenshot_5F00_8.png

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans