Need help with random reference number
Hi. I am currently making a time sheet in Adobe Acrobat DC which requires a unique reference number everytime a new person fills it out and sends it in. I have tried several things and besides setting up a database the pdf can connect to and extract a new number from which wasnt used, this is what i came up with.
I made a button you can click on "LøbenummerKnap" (sorry for the danish), when clicked it fills out my field with a new random number which is based on time. And it works.
My problem is that i need it to be as short as possible but still guaranteeing the next number is unique to what have bin given earlier.
This is my code on the button:
var d = new Date();
//Divide by 100 to get miliseconds
this.getField("Løbenummer").value = Math.floor(d / 100);
So every milisecond a new number is assigned to my "Løbenummer" field if the button is pressed. The odds of anyone clicking the button at the same milisecond is very very unlikely, but my boss still wants the number to be shorter for further processing by the company.
Is it possible to make the output shorter whitout changing the fact the people wont get the same number?
