- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 08:21 AM
Variable (Type: Lookup Selectbox ) Lookup Value from table having Reference Qualifier is not working on Variable editor.
i'm working on a requirement on Record Producer, The Requirement is as follows
User will fill some minimal data while submitting the record producer, once the record producer is submitted a custom table record will be created
The record created will have variables (which are hidden during form submission) those variables contains drop down values (Look up Select Box) populated from some tables.
Suppose just as an example consider the table below
TABLE: COUNTRIES& CITIES
Country | City |
---|---|
USA | Washington DC |
USA | DALLAS |
USA | Chicago |
INDIA | MUMBAI |
INDIA | HYDERABAD |
INDIA | PUNE |
AUSTRALIA | SYDNEY |
CANADA | TORONTO |
CANADA | OTTAWA |
Variable1:
Name: country_1
Lookup From Table: COUNTRIES &CITIES
Lookup value Field: Country
Unique Values Only: True
Variable2:
Name: city_1
Lookup From Table: COUNTRIES &CITIES
Lookup value Field: City
Reference Qual: javascript:'u_country='current.variables.country_1
So the above configuration in Variable2 is populate the values based on country_1 variable on record producer
i.e. if country_1 field contains USA as selected value then city_1 field will only populate Washington DC, DALLAS, Chicago in drop down list.
This functionality is working good on Record Producer but the similar functionality is needed on Form's variable editor where if country_1 value is changed corresponding city_1 values should get populated. This is not working in Variable editor.
Any help is really appreciated.
Thanks,
Vamsi
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 12:34 AM
Hi,
I got the reason behind it
the reason is as follows:
Reference qualifiers in look up select box will not work on OnChange. We have to write OnChange catalog client script on Application variable and you can dynamically populate the options for Operation variable by querying the look up table.
Thanks,
Vamsi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 09:47 PM
Hi Vamsi,
As record producer and Form are two different things. you need to write same Client Script which you have written for record producer.
Scripts written for record producer form is limited to itself only, it wont be applied to record form.
you can find more on below links;
What is the difference between Record Producer and a Form to get record?
http://wiki.servicenow.com/index.php?title=Record_Producer
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 11:27 PM
Hi,
On form you need to write reference qualifier for Variable 2. and filter it based on Country sys_id.
if you need I will send you code.
it is good if you create a include script and create a function for same in it.
and call function in reference qualifier.
for more detail see it.
Reference Qualifiers - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 12:07 AM
Hi Sanjeev,
Thanks for your reply,
I think i need to articulate the question much more clearly.
Yes i did the same, i have written reference qualifier and it is working as expected on Record Producer, but after submission of Record Producer on Ticket's Variable editor it is not replicating the same.
Thanks,
Vamsi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 12:34 AM
Hi,
I got the reason behind it
the reason is as follows:
Reference qualifiers in look up select box will not work on OnChange. We have to write OnChange catalog client script on Application variable and you can dynamically populate the options for Operation variable by querying the look up table.
Thanks,
Vamsi