- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 12:50 AM
Hi,
I have a client script where I use the value of a variable as a reference to populate rest of the fields. But this is not working when it is a lookup select box. Why is it so? I have added the code here and the outcome.
Here intsall_status is a lookup select box in a catalog item. How can I set value in the field?
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 05:50 AM
It worked, I changed the look up table of the variable from sys_choice to alm_asset.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 12:55 AM
Hi
use setDisplayValue instead of setValue.
Let me if this works.
Regards
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 01:02 AM
Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 01:10 AM
"getReference" will not work on a Lookup Select Box! It works on "Reference" fields.
It is not recommended to use getReference() in client side
please use GlideAjax and Script Include approach
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 01:48 AM
I used it but still no change! I'm trying to populate this field but it is not showing the value which is in the record. The value in the record is "missing" but everytime the catalog item is opened, the field is showing this "consumed" value by default. I have not given any default value in the variable specification too.