Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Synchronous workflow makes calling asynchronous workflow fail

Posted on by 415

Hi guys,
Anyone experience with this particular error type (google let me down terribly)? "Error while calling OnBeginRequest on WorkflowTransactionContext"


It’s about workflow 1 that copies fields from Entity A to Entity B. Workflow 2 is triggered by some fields on Entity B changing.
Workflow 1 is asynchronous. Workflow 2 is realtime/synchronous.

 

Workflow 1 isn’t finished (usually) before Workflow 2 starts running and it seems as if they don’t like eachother. The step in Workflow 1 in which fields are changed that might trigger Workflow 2 sometimes (not always, not even with the same records) fails with this message:

 

Plugin Trace:

 

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]

[UpdateStep13]

 

           

            [Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]

            [e7e0df69-f91a-e911-810f-02bfac10284b: ]

            Starting sync workflow 'Connectie aanhef/adressering', Id: dae0df69-f91a-e911-810f-02bfac10284b

            Entering ConditionStep28_step: Staat "Automatisch bepalen" op "Ja"?

            Entering CustomActivityStep66_step: Briefadressering erven

            Entering CustomActivityStep67_step: Briefadressering erven (getrimd)

            Entering ConditionStep70_step: Is er een tussenvoegsel ingevoerd?

            Entering UpdateStep74_step:

            Entering ConditionStep75_step: Zijn er intialen ingevoerd?

            Entering UpdateStep77_step:

            Sync workflow 'Connectie aanhef/adressering' terminated with error 'Error while calling OnBeginRequest on WorkflowTransactionContext.'

           

 

 

Error Message:

 

Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Error while calling OnBeginRequest on WorkflowTransactionContext.

 

 

 

Turning on server tracing shows little more than:
MessageProcessor fail to process message 'Update' for 'contact'. (contact = Entity B)

And

Inner exception: Unhandled Exception: System.ArgumentException: An item with the same key has already been added.

And the repeating of the “error while calling OnBeginRequest” a few times.

 

Any idea what I’m looking at here? (or, even better, how to solve/prevent it)

 

Thanks for thinking along with me.

Best regards,

Jeroen

*This post is locked for comments

  • Jeroen J Profile Picture
    Jeroen J 415 on at
    RE: Synchronous workflow makes calling asynchronous workflow fail

    Oh, forgot one more thing. If I make Workflow 2 Asynchronous, everything runs smoothly.

    That's totally unwanted though, it was one of the most important requirements when creating it.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans