I am not sure what a webservice call is. By reading online documentation I tried using a variable as a place holder to increase the number by one each time the form is submitted, but that does not seem to work.
A variable in the form can only keep track of data within that instance. If 5 people open it, all 5 will start at the same number. If the form is opened from disk by a single person, submitted, closed and reopened, it starts at the same number again. You have to have some common point of keeping track of the number. So you have to make a server call, webservice, database, etc. It cannot be done within the scope of a stand alone PDF form.
You can also use a UUID (Universally Unique Identifier)
$.rawValue = Uuid(1)
Which results in a string like this:
I've just been playing around with this function recently but the resulting string is rather unwieldy. I like the idea of using Time(), it gives an easier-to-deal-with number as a result - thanks Paul!
I tried it longhand as well and got the same answer... The next problem is getting it to stay static on reopening. I am thinking of getting a convert to string script on the submit button and generating a barcode...
The issue may be that "LiveCycle Designer ES defines day one for the epoch for all date functions as Jan 1, 1900".
The website you referred to has the following statement "Epoch has a few meanings (see also http://dictionary.reference.com/search?q=epoch). The definition that we'll use is "0" in computer time. While there are folks who will argue this, for our purposes, this "0" time on our calendar was January 1, 1970 00:00:00 GMT"
That would explain why the answer is approximately 70 years off!!
I think I will use your script (thanks!), but truncate the answer to the last 8 digits.