Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

[CRM2011] Custom Workflow Activity - Cross instance interference

Posted on by Microsoft Employee

Hi all

I have a custom workflow entity that accepts three lookup input parameters and returns one output parameter of type Money.

It is defined on an active process that's triggered on the creation of Invoice Product.

Our system generates bulk invoices (up to 30), and therefore ~40 Invoice Products can be created instantly.

With the result that the output from one instance of the workflow is carried into another giving incorrect results.

If I run the workflow manually again, it returns the correct result.

I have defined the IOrganisation Service in the Execute Method and pass it to sub routines (as opposed to class level var - as I received strange errors that way)

I believe this is a bug. 

Is there a workaround?

Perhaps there is a way to allow the workflow to sleep for a random number of minutes? How can this be achieved?

Any solutions or suggestions would be greatly appreciated

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: [CRM2011] Custom Workflow Activity - Cross instance interference

    Hi

    In CRM 2011 all workflows are ASync.

    The above suggestion would simply delay all the workflows for 5 minutes, and therefore the same issue will occur 5 minutes later.

    Is there some way to use a random amount of time as opposed to a fixed 5 minutes?

    I am currently writing another workflow that simply does the following:

    Dim RandomV As New Random()

    _FutureTime.Set(context, Now.AddSeconds(RandomV.Next(10, 240)))

    Will see if it works.

  • Ganesh Chowhan Profile Picture
    Ganesh Chowhan 160 on at
    RE: [CRM2011] Custom Workflow Activity - Cross instance interference

    Hi,

    I believe your workflow configured as Real Time workflow?

    If background workflow You may use Wait Condition Timeout in workflow step. See if this help you out.

    34604.Capture.JPG

    Thank you!

    Ganesh

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans