GlideRecord get label of reference field instead of sys_id

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2016 12:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2016 12:32 AM
Hi Cris,
Use getDisplayValue()
-Giri

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2016 12:35 AM
Hi Chris,
Since it looks like you're working on a client-side script, you can't use GlideRecord's getDisplayValue() method, which is only server-side. And you can't dot-walk to drill down through the referenced record to it's display value field.
Since you have to pull a set of records and get both sys_id (for the value) as well as the display value, I would suggest writing an AJAX script to compile and return the data you need:
Your other option might be to manage it through a reference qualifier for your reference drop-down.
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2016 12:35 AM
Is this a custom table? Do you have the display column set to true for the field you'd like to see?
http://wiki.servicenow.com/?title=Reference_Fields#Selecting_the_Display_Value&gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2016 06:13 PM
What Robert said