Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

How can I create a unique identifier that wont change each time the file is opened?

Avatar

Level 1

I am using Lifecycle designer that came with webpremium suite 3.  I used the UUID script to create a unique id -- it changes each time the form is opened, which is fine if we just fill out the form and print it, but it also changes once the form is filled out and saved as a different name and opened again.  Is there a way I can create a unique id or form number that will not change once the file is saved?

6 Replies

Avatar

Level 6

This is quite simple....as simple as playing a trick. I would add a hidden field on the form and set the Binding to "Normal". Then under preSave event I would add code to like following....this.rawValue = <UUIDField>.rawValue;

And make following change to the UUID request process

if (<BackupUUID>.isNull) {

          //get the UUID

          //that means you will request UUID only if the form is rendered of the first time certainly not after user saves it.

}else {

     <UUIDField>.rawValue; = <BackupUUID>.rawValue;

}

Avatar

Level 1

WOW!!! Thanks a million. (I am not a programmer -- just a marketing weenie, so I would never have figured this out!)

Scott Dockendorff

Marketing Coordinator

Phone: 978-667-5200

Email: sdockendorff@iesc1.com

Avatar

Level 1

Sorry to bother you again, but I am getting an error... so here is what I did:

Created 2 text fields -- one will be hidden. For that one I set binding to Normal and under preSave (formcalc) I entered the following:

.rawValue = .rawValue;}

I have attached a screenshot of the error I get.

Once again, THANKS FOR YOUR HELP. Making this work means that we can eliminate numerous paper forms.

Scott Dockendorff

Marketing Coordinator

Phone: 978-667-5200

Email: sdockendorff@iesc1.com

Avatar

Level 6

with your coding style I can say you are fairly new to using this tool or coding in Javasript.....

Just email me (n_varma AT lycos.com) copy of your template I will fix it for you....then you can learn from comparing the code blocks.

Avatar

Level 6

I used following steps and it works on my machine.....
1. I copied UUID field "TextField2" and pasted close to it and named it "UuidBackup"
2. Changed "TextField2" visible property to "invisible" in the object pallet.
3. Add following JavaScript code in docReady event of UuidBackup
if (this.isNull) {
this.rawValue = this.parent.TextField2.rawValue;
}
4. Aline both TextField2 and UuidBackup field exactly one on other.

Save and try the results.....

Avatar

Level 1

I will try it. thanks

Scott Dockendorff

Marketing Coordinator

Phone: 978-667-5200

Email: sdockendorff@iesc1.com