I have created a simple work order. I have the need of assigning the work order an ID of some kind. I'm not really concerned about the ID topology. The ID should not be incremented for page copies. So let's say I had a hypothetical ID of 9000 and I printed 5 copies. All 5 copies should have the same ID of 9000. This ID should be present and ready to go upon the user opening the FORM. It should be calculated value with no interaction required (or able) from the users perspective, just open the work order and it's assigned this hypothetical ID and is ready to go.
I have looked around but can not fine a canonical answer on how this could be accomplished. Do any members of the community have and ideas?
Solved! Go to Solution.
Views
Replies
Total Likes
There is a FormCalc function for generating a unique identifier but it creates a pretty long and cumbersome string. The syntax is Uuid(0|1). Uuid(0) creates a string with no dashes and Uuid(1) adds dashes.
The following is a script I've used quite a bit, it creates a number based on the date and time. The result is a ten-digit number (number of seconds since the epoch).
You can take the null check out if you don't need it - it's there so that if the form is saved and re-opened the number stays the same. The script is on the Initialize event of a text field.
if (this.rawValue == null)
{
var d = new Date();
this.rawValue = Math.floor(d / 1000);
}
Views
Replies
Total Likes
There is a FormCalc function for generating a unique identifier but it creates a pretty long and cumbersome string. The syntax is Uuid(0|1). Uuid(0) creates a string with no dashes and Uuid(1) adds dashes.
The following is a script I've used quite a bit, it creates a number based on the date and time. The result is a ten-digit number (number of seconds since the epoch).
You can take the null check out if you don't need it - it's there so that if the form is saved and re-opened the number stays the same. The script is on the Initialize event of a text field.
if (this.rawValue == null)
{
var d = new Date();
this.rawValue = Math.floor(d / 1000);
}
Views
Replies
Total Likes
This should work just fine. Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies