- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 04:32 PM
I created this client scripts on the incident table.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var abc=g_form.getValue('assignment_group');
alert(abc.Name);
}
Everytime we changes the value in assignment group I want to show that value in alert. Right now its showing the sys_id value.
Please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 04:43 PM
try this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var abc = g_form.getDisplayBox('assignment_group').value
alert(abc);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 04:43 PM
try this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var abc = g_form.getDisplayBox('assignment_group').value
alert(abc);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 05:50 PM
??
from where did you get 'getDisplayBox' method??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 05:55 PM
it works, but how come I do not see this method on wiki?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 05:57 PM
It most likely is not fully supported and not within best practices. See below for the correct method:
http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#getReference