I have an adobe form that users can download. I want any time a form is downloaded the numbers that appear on it are unique. Is there a way out?
First of all, I would create a field called GUID.
// add a seed to randome number generator, RDF
now = new Date();
seed = now.getSeconds();
// replace 0×10000 with this format: *parseInt('10000′,16); RDF
// replace substring(1) with a 4 digit hex string like this: substring(1,5); RDF
return ((1 +Math.random(seed)) *parseInt('10000' ,16)).toString(16).substring(1 ,5);
return (S4() +S4() +"-" +S4() +"-" +S4() +"-" +S4() +"-" +S4() +S4() +S4()).toUpperCase();
Then, from the form:ready event of my invisible field I would call the generateGuid() method and save the content inside the field. The "if" condition would prevent update of the Guid everytime the user reopen the form.
this.rawValue = utils.generateGuid();
Of course, in that way the GUID is generated not at download time, but when the user opens the form. Otherwise, you can generate the GUID server side (I think you can use the method randomUUID() of the uuid class) and prepopulate the form with that data.
Hope this helps,