Hello,
My name is Rick and I really need your help.
While building a form that helps end-users report complaints, I'd like my form to automatically make a casenumber by combining two fields.
I've tried figuring scripts out on my own, with the 'help' function, searching forums but no salvation yet.
I look forward to your reaction!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Just for starters, it looks like you have the script in a numericField. Change the type to a textField.
Niall
Views
Replies
Total Likes
Hi Rick,
LC Designer has two languages: Javascript and FormCalc.
You can use either one for your requirement. FormCalc is handiest as it includes a concatenation function that can join multiple fields into a separate field.
If the two fields are 'fullName' and 'location' the script in the calculate event of the caseNumber field could be:
$ = Concat(fullName, "/", location)
In Javascript it would look like this (also in the calculate event):
this.rawValue = fullName.rawValue + "/" + location.rawValue;
Either of these should achieve what you want.
Good luck,
Niall
Views
Replies
Total Likes
Thanks a lot for your help! Still, it isn't working properly. The form doesn't execute the script when I send it, leaving te field saying "0". This is my script: this.rawValue = Datum.rawValue + "/" + Organisatie.rawValue
Views
Replies
Total Likes
Hi,
Just for starters, it looks like you have the script in a numericField. Change the type to a textField.
Niall
Views
Replies
Total Likes
Thanks! That's it!
Can i also add something to the script to provide a random number?
Views
Replies
Total Likes
Hi,
Here is a sample where the reference number is the full date and time, down to the second. https://acrobat.com/#d=7MTJmmhWCVSfQQir3XwxXQ
Here is a sample of a random number generator. It creates a 4-digit random number of a click event, but you can extend this. https://acrobat.com/#d=iVdJ1rAWKPL7qXj8zLs9yg
Good luck,
Niall
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies