Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Workflow issue in concurrency

Posted on by 680

Hi,

We have developed custom workflow to perform functionality to increment counter like Auto number. 

For example when account is created/updated then it will update count on another custom entity. When account is created/updated our WF fires and retrieve Custom entity record and then increments count by 1 and update custom entity with new counter .This functionality works correctly when we create single record but when we do bulk update then it fails. It does not increment counter correctly. 

For example when we select the 250 accounts from Home page grid and run the workflow then our WF fires and retrieve Custom entity record and then increments count by 1 and update it in custom entity. It fails to increment count correctly. Instead of 250 it increments count by 235. When we do the same process then it will increment count by 240. We found that when we retrieve record then it returns the same counter for different record. 

To resolve this issue we used solution given in below link but it did not work. 

msdn.microsoft.com/.../dn707955.aspx 

Note: The workflow is Async. 

Is anyone facing such type of issue and has solution for it. 

Thanks! 

Balasaheb

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Workflow issue in concurrency

    Hi,

    This is a known issue and is very prevalent in the Auto number solutions. However there is a way to overcome this. In you code logic where you are retrieving the counter value, do a dummy update (set some dummy field) which will internal lock the entity for that individual transaction. Thus for each core operation, you will receive the correct number.

    Hope this helps.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans