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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Concurrency in with the field type 'Auto number'

(1) ShareShare
ReportReport
Posted on by 10

Hi,

I am currently experiencing concurrency issues with a custom built auto number entity and came across this link: 

https://jonasr.app/2020/03/anm-unique-seq/

To my surprise the new UI offers a auto number data type, I am however a bit concerned how this data type handles concurrency issues. I have not been able to find any MS source explaining exactly how this field works, does it utilize SQLs built in auto number feature or how does it work?

I have a system with a high load from an external API and internal plugins creating transactions. It is very important that all transactions get a unique number and are not subject to any concurrency related exception as I am currently experiencing with the current, optimistic concurrency approach. This main issue is that the full database transaction is rolled back, which causes issues when sales are coming in from integrated systems.

Please let me know if you have came across similar issues and how these were handled. 

I cannot utilize the 'normal' auto number feature as the increments are different based on the customers brand etc. Meaning I would need some kind of plugin logic as described in the link above.   

I have the same question (0)
  • Suggested answer
    LuHao Profile Picture
    40,892 on at

    Hi aasdasd,

    In order to solve the concurrency problem, we recommend that you set the format of all auto number fields to number + random string, which is also the format Microsoft uses for OOTB auto number fields (such as Quote ID).

    pastedimage1605147677157v1.png

    In fact, the mobile offline feature of D365 would cause concurrency, and they've devised a solution for this by using random strings to avoid the duplication of pure numbers, but it doesn't seem to be mentioned in the D365 documentation.

    When you create a autonumber field, select autonumber type to Custom, then select Add random string to format.

    You can change the number of character digits by changing the highlighted number.

    pastedimage1605148252579v2.png

    In this way, even if concurrency occurs and the number part is duplicated, the random string part will be different, thus avoiding the problem of duplicate values in the auto number fields.

  • aasdasd Profile Picture
    10 on at

    Hi Lu,

    Thanks you for your reply.

    Unfortunately the requirement for this formatting is that there is one character prefix with four numbers (ex T1111).  

    However, I tested the solution by running three instances of Visual Studio and creating 50 records/instance which seems to be working. This setup previously triggered my concurrency issues at least.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 177

#2
ManoVerse Profile Picture

ManoVerse 54 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans