Getting value of the field instead of sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2013 08:21 AM
I have a script where I do a GlideRecord query to the request table. Once I get the records, I am getting to the value of the opned by field. But since opened by is a reference field, it is returning sys_id. How can I get the displayed value ?
Below is the script :
var gr = new GlideRecord("sc_req_item");
gr.addQuery("u_requested_for", g_form.getValue("emp_name"));
gr.addQuery("stage",'!', "waiting_for_approval");
gr.query();
if(gr.next())
{
alert("A request has already been submitted by " + gr.opened_by); // this is returming sys_id, I need the value
}
Please let me know if anyone has any suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2013 12:47 PM
You cannot 'dot walk' in a client script. I'm assuming this is a client script since you are using 'g_form'.
You will need to find the record for the 'opened_by' in the sys_user table and look at the name field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2014 12:30 PM
Wanted to post and say that using ".name" worked well for me. I am using a Business Rule and tried getDisplayValue() first with no luck.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2016 04:26 PM
.name is undefined in Helsinki. Why are reference fields so hard to work with?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2016 07:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 07:44 AM