Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Auto assign a requisition / order number

Avatar

Former Community Member
We have made our Requisition form available in as a PDF. The problem we are having is that each requisition needs to have a unique requisition number so the customer has something to refer to when tracking the order.



Is there a way to set up the form to auto assign a unique number? This number could be tied to date and time just so that it generates an identifying number.
5 Replies

Avatar

Former Community Member

Yes ...there is a FormCalc function that will return the number of seconds form a point in time (called an Epoch). If you use the time() function it will return that number. As long as 2 users do not open th eform at exactly the same time then you can be guaranteed a unique number.

Paul

Avatar

Former Community Member

I found this thread on a search, as I have the same issue. Piggybacking on this question, this does work assigning a unique number, however for me, that PDF is e-mailed to another group as well as saved by the user. But now, when either of those people open that PDF, the number continues to incriment. Is there a way to make it not change once the PDF has been saved/e-mailed? My thought would be to make the entire form become read only, but I am not sure that would even fix it?

Avatar

Former Community Member

Do a check on the field to see if it is empty before doing the calculation. This way if the field is empty then the calc will fire...if there is already something in the field (presumably a form number) then it will not recalc.Something like this:

if (this.rawValue == null){

    do number calculation

}

Paul

Avatar

Level 9

Another option is to inject a unique number into the form within the process itself.

This component generates a sequential number with optional prefix and suffix, and allow you to inject it into the form.

Doc: http://avoka.dnsalias.com/confluence/display/Public/Unique+ID+Generator+DSC

Download trial: http://www.avoka.com/avoka/escomponents.shtml

Howard

Avatar

Level 10

You could inject the unique number from the process.

You can use the process variable /process_data/@id, which will give you an unique identifier for your instance.

Jasmin