web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer Service forum

Auto-numbering - Real-time workflow / transaction / C# Mutex

(0) ShareShare
ReportReport
Posted on by

Hello all,

I'm in the process of developing a solution in Dynamics 365 Online (so I'm in the isolates mode) that will contain multiple business units. Each business unit will use the Case entity, however, they will have the case number generated differently. E.g. business unit A will only have incrementing number (1,2,3,4,5..n) and business unit B will have e.g.: DEP-1, DEP-2, DEP-n...

I would like to implement this using a non-coding approach and I had the real-time workflow in mind.

I know that a real-time workflow runs in stage 30 in the execution pipeline (which makes the real-time workflow part of a transaction) and it's also possible to create a plugin that runs in stage 20, to also be part of a transaction.

However, reading up on various blogs (without testing myself) I can see, that even though that the workflow and the plugins would run in a transaction, there would still be scenarios where I could have race conditions where cases might get the same Case numbers, and that I would have to implement .NET Mutex magic in plugins as a work-around.

Is this really true? Coming from a database background, I do not understand, that I would have race conditions when the a workflow/plugins runs in, and manipulates entities in a transaction.

Can someone explain it to me?

Categories:
I have the same question (0)

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 > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans