Random numbering

Henry
Member Posts: 18
Hello guys (and girls),
I hope one of you can help me out with the following problem:
For our batch numbering i've created a new no. serie where i make use of the default numbering (automatically). This because the batch no. has to be unique.
Example:
A001, A002, A003......
The problem is that i would like to use a random numbering where each number must be unique.
Example:
A001, A871, A342....
Is this possible in Navision? Thank you for thoughts!
Greetzz,
Henry
I hope one of you can help me out with the following problem:
For our batch numbering i've created a new no. serie where i make use of the default numbering (automatically). This because the batch no. has to be unique.
Example:
A001, A002, A003......
The problem is that i would like to use a random numbering where each number must be unique.
Example:
A001, A871, A342....
Is this possible in Navision? Thank you for thoughts!
Greetzz,
Henry
0
Comments
-
Without coding this is not possible. But you can extend codeunit 396 to behave like you want. I would store every created number in a separate table and compare my new random number with this table.
But this would put a growing load on the server, depending on how much numbers will be created...0 -
Maybe you can use Year Month Day Hour Minutes Seconds to form your Batch No.?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks Luc & AK for your replies.
With the function RANDOM(IZE) i can create raondom numbers but to be unique i have to check all batch no.'s (like AK mentioned). This will lead to bad performance (like AK mentioned). Does anybody knows what other solution to use?
Unfortunately i can't use YEARMONTHDATE because the batch no. has to be printed on the article and we have a limit on the characters we can use.
Thanks,
Henry0 -
Another solution could be to create a formula which calculates a unique number out of some given parameters, for example date, time and costumer no.
Could be as simple as formatting date (e.g. 18/12/02), time (10:32:17) and costumer no (4711) into one number (1812021032174711) and converting it into a hex value (6700605F2C477). This is of course not a random number, but it looks like one. And it's too long for your purpose, but may be it is a starting point.
Actually I have no idea about how to prove if the number is really unique (when using another formula than the one above)... Any mathematic whizkids around?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions