Skip to main content

Notifications

Announcements

No record found.

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.   

  • aasdasd Profile Picture
    10 on at
    RE: Concurrency in with the field type 'Auto number'

    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.

  • Suggested answer
    LuHao Profile Picture
    40,888 on at
    RE: Concurrency in with the field type 'Auto number'

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

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

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

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans