- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2014 09:47 AM
Not sure why but the getDisplayValue for the Glide List is coming out as sys_ids. This Glide List (u_linked_records) is a list of entries in the Task table.
var newLR = current.u_linked_records.toString(); //New Array of the Linked Records gs.log('SYS_ID Value: '+current.u_linked_records.toString()); var newLRArr = newLR.split(","); var newLRNum = current.u_linked_records.getDisplayValue(); //New Array of the Linked Records with Numbers gs.log('Display Value: '+current.u_linked_records.getDisplayValue()); var newLRNumArr = newLRNum.split(",");
Result:
SYS_ID Value: 217a717934be11003fd4f7967b28e115,52bebd7934be11003fd4f7967b28e194
Display Value: 217a717934be11003fd4f7967b28e115, 52bebd7934be11003fd4f7967b28e194
Any help would be appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2014 06:15 AM
this should work fine for you.
https://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script
Did you check if you display value is set to true for the dictonary field 'number' on the task table?
Tested on calgary instance, and its working fine for me.
var gr = new GlideRecord('incident');
if (gr.get('9d385017c611228701d22104cc95c371')){
gs.print(gr.number) //show me the current incident nummer
var newLRNum = gr.u_related_records.getDisplayValue();
gs.print(newLRNum)//show me the display value of the watchlist.
}
*** Script: INC0000002
*** Script: CHG0000001, CHG0000002
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2014 08:02 AM
linked records is a reference field so you are ending up retrieving the record that contains the link.. not the reference field value...
i would probably thumb through the linked records... using get reference to get the referenced object.. then you can get the correct name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2014 06:15 AM
this should work fine for you.
https://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script
Did you check if you display value is set to true for the dictonary field 'number' on the task table?
Tested on calgary instance, and its working fine for me.
var gr = new GlideRecord('incident');
if (gr.get('9d385017c611228701d22104cc95c371')){
gs.print(gr.number) //show me the current incident nummer
var newLRNum = gr.u_related_records.getDisplayValue();
gs.print(newLRNum)//show me the display value of the watchlist.
}
*** Script: INC0000002
*** Script: CHG0000001, CHG0000002
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2014 09:30 AM
This is exactly what I had to do, which was an extra step I am not happy about. I should be able to just directly reference. Meh. It's done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 09:22 AM
How would you implement this on a record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 11:29 PM
for as I'm aware there is no List element for record producers/ catalog items. What do you want to achive?