
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 11:05 AM
I'm doing a g_form.getReference on the cmdb_ci field in a client script for incidents. I'm trying to dot walk to a specific filed that is part of a specific class. The filed is only on this class and when I do ci.u_service_level I get undefined. What do I need to add to be able to get that field thought a dot walk via script? Or am I going to have to do a GlideRecord query? Below is my script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.getReference('cmdb_ci', function(ci){
if (ci.sys_class_name == 'u_cmdb_ci_myclass'){
alert(ci.u_service_level);
}
});
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 11:39 AM
And I would recommend doing a GlideAjax call fore this as well to make sure you get the information you really want.
LinkedIn & Twitter
Subscribe to my YouTube Channel
Buy The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 11:38 AM
Ahh that is probably the reason, you are using getReference on a field that is reference to the cmdb_ci table. And the field you want to get isn't on that table, but on an extended table. That means that when you query the record from cmdb_ci, you won't get back that field, only the field that exist in the cmdb_ci table.
LinkedIn & Twitter
Subscribe to my YouTube Channel
Buy The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 11:39 AM
And I would recommend doing a GlideAjax call fore this as well to make sure you get the information you really want.
LinkedIn & Twitter
Subscribe to my YouTube Channel
Buy The Witch Doctor's Guide To ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 12:14 PM
That is what I figured but just wanted to see if there was a way to do it.