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
Well, something tells me, that i will do it by myself (don't want TT.TT)
Well, definitly this i do in my workflow, like on ur screenshot
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):
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/
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.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156