Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Asynchronous workflow issue with counter increment

(0) ShareShare
ReportReport
Posted on by 698

Hi,

We have developed the asynchronous workflow in that we have logic to increment  the counter in of our entity. It is working fine when we checked with the few users but when multiple users create/update the records same time then it assign the duplicate counter so it will failed our logic. 

We tried to use the locking by updating the dummy record but it was not works due to asynchronous workflow. 

Is anyone have same solution for the same to increment counter without duplicating in asynchronous workflow assembly.  

Waiting for your reply.

Thanks!

Balasaheb

  • Balasaheb Profile Picture
    698 on at
    RE: Asynchronous workflow issue with counter increment

    Hi,

    We have used the Optimistic concurrency mentioned in below link but when exception thrown when data mismatch then we catch we again call function to retrieve and update that record once again but some time it goes into loop and thrown stack overflow error. Can any one use this and face same issue and have solution to resolve it.

    docs.microsoft.com/.../dn707955(v=crm.8)

    Note: We have checked this in Async workflow and we want this in Async workflow only.

    Waiting for your reply.

    Thanks!

  • Joana Pinto Profile Picture
    740 on at
    RE: Asynchronous workflow issue with counter increment

    Hi,

    Sorry but why can't you have synchronous workflows? Because I don't think that's possible to achieve this with asynchronous methods. You will not guarantee the value will be valid.

  • Balasaheb Profile Picture
    698 on at
    RE: Asynchronous workflow issue with counter increment

    Hi,

    Thanks for your reply but we do not want synchronous workflow. We have to keep workflow running  Asynchronous mode.

    Is there any way to do the same in Asynchronous workflow.

    Thanks!

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at
    RE: Asynchronous workflow issue with counter increment

    Asynchronous workflow will run on its own schedule, and it might be multiple instances of workflows will execute at same time to process more records, and that is causing for duplicate auto number.

    As above mentioned you need to convert Asynchronous workflow to Synchronous then only it will work properly or create Plugin which will be executed on Pre-create event, which will get autonumber first and then record will be created.

    Hope this will help..  

  • Suggested answer
    sardar ahmed Profile Picture
    520 on at
    RE: Asynchronous workflow issue with counter increment

    Hi,

    Try changing your workflow to synchronous

  • Joana Pinto Profile Picture
    740 on at
    RE: Asynchronous workflow issue with counter increment

    Hi,

    If you are using an auto number solution, don't use an async workflow. Use an synchronous workflow because you want the counter to be updated right in that moment, now allowing other process to run.

    Regards,

    Joana

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 95

Overall leaderboard

Product updates

Dynamics 365 release plans