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.
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.
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).
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156