Get the value of reference field using glideajax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 10:49 PM
How to get the display value of reference field in script include and use it in client script. I have done it using getdisplaybox but it is not supported or throws an error in some places, hence would like to do it through glideajax.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 10:50 PM
Hi,
you can use g_form.getReference() with call back method to dot walk and get the field value which is display
but what error you are getting for getDisplayBox() can you share that?
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
11-05-2019 12:37 AM
Can you provide a sample script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2019 01:18 AM
Hi,
consider you have caller_id field which refers to sys_user table and you want to get the display value for this i.e. name you can have something like this
var callerName = g_form.getReference('caller_id').name;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
11-04-2019 10:51 PM
Try with getDisplayValue() method