- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-21-2020 11:47 PM
Hi please help me with the following:
I have 2 lookup select box variable both has lookup from table as sys_user. One for lookup value field Email and another for lookup value field Employee number. I want to set the value of Employee number variable based on the email chosen.
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-22-2020 12:59 AM
Hi Vivek,
Yes, Tested the same & it seems getReference would not work as its look-up reference field.
I suggest you to
1. Mark the script -False
2. Only use reference qualifier as below.
javascript: 'email='+current.variables.email;
Tested the same & it works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-21-2020 11:55 PM
Hi Vivek,
For the Employee number look-up can you try using below as reference qualifier
javascript: 'email='+current.variables.email;
Additionally, you can use an onChange() client script that runs when Email variable field changes.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var emailis = g_form.getReference('email', empnois);
function empnois(emailis) {
g_form.setValue('employee_id', emailis.employee_number);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-22-2020 12:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-22-2020 12:39 AM
Hi Vivek,
There is a typo in your script.
Line 8 should be emp.employee_number & not emailis.employee_number
Also, if you are using script then you need not use the reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-22-2020 12:48 AM
Hi,
Yes I have changed it, but still the same