ATS custom national number generator

0
We have a test case in ATS where we have to fill in a form. In that form a national number has to be entered. But a national number can only be used once. How can we add custom logic to generate a random national number in ATS.
asked
2 answers
1

There is a function to generate random numbers, if you make the range large enough the chances that you will get the same number twice is insignificant

https://docs.mendix.com/addons/ats-addon/rg-two-function-reference#11-generators

answered
0

Altenatively, you could use a datetime stamp (function Get Current DateTime String), which is always unique if you make it detailed enough for your test case. For instance, if you generate such a number every minute, make sure the datetime string contains something smaller than minutes (seconds, or milliseconds). If you use date format without white spaces or special characters, ‘yyyyMMddHHmmssSSS’ for instance, you get something back that is numeric only and could possibly be used as national number.

Check out the link below if you need information about how to create a valid DateTime format:https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

answered