- 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-10-2014 10:02 AM
What is your display value set to on the task table? Normally it would include the number column for display. If this has been changed, it may come back with sys_ids as the display value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2014 11:35 AM
What do you mean exactly? My numbers always display correctly, such as INT00000001, REQ00000001, etc. The u_linked_records is a field I made myself on a custom form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 07:47 AM
The number column is the display value, I am using the task table for the numbers. So REQ0000001/INC00000001/SUP0000001, etc etc...
Number is set to display as true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 07:37 AM
Anyone have suggestions for this?
Thanks!