
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 01:41 PM
Evening All,
I am trying to get a display value from an incident form field using an onChange client script.
My current code:
var client = g_form.getValue('company');
alert("Client: " + client);
is returning a sys_id instead of the value and since client scripts don't support getDisplayValue I am at a loss. I've seen a bunch of different code snippets to get around this but non work on my Jakarta instance.
Any idea how I can get this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 02:00 PM
Ok. Looks like it works in Service portal but not on IT.
The other option is
var comp = g_form.getReference('company', getCompany);
function getCompany(comp){
alert(comp.name);
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 02:00 PM
Ok. Looks like it works in Service portal but not on IT.
The other option is
var comp = g_form.getReference('company', getCompany);
function getCompany(comp){
alert(comp.name);
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 02:10 PM
i'll be damned. I tried that code before and it didn't work but when I copied your version it did!
Thank you very much and have a great weekend!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 10:14 AM
This works great. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 01:47 PM
g_form.DisplayBox('YOUR REFERENCE FIELD').value;
Please use this.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2018 01:50 PM
onChange script error: TypeError: g_form.DisplayBox is not a function function