- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2012 09:27 AM
Hi,
I have a table cmdb_ci_computer which extends cmdb_ci table. In one of the email notifications, I am tryign to get the fields from cmdb_ci and 2 feilds from cmdb_Ci_compter( which is a child of cmdb_ci)
var gr = new GlideRecord("cmdb_ci");
gr.addQuery('assigned_to', current.requested_for);
gr.query();
while(gr.next()) {
if(gr.sys_class_name == 'cmdb_ci_computer')
{
template.print("Employee has "+gr.sys_class_name.getDisplayValue()+ "\n");
template.print("Form factor "+gr.cmdb_ci_computer.form_factor+ "\n"); // this is computer_ci_computer table
template.print("Asset Tag "+gr.asset_tag+ "\n"); //This cmdb_ci field//
template.print("------------------------\n");
}
}
I am trying to access form factor from amdb_ci_computer. I know I can do one more glide query, but can I do with dot walking to child table?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2012 09:50 AM
You can't just dotwalk, unfortunately. But if you have a GlideRecord gr for the base table (cmdb_ci), you can do the following to get a GlideRecord for the extension table, where you'll have access to the extension table's fields:
var gr2 = new GlideRecordUtil().getGR(gr.sys_class_name, gr.sys_id);
GlideRecordUtil is a Script Include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:46 AM
Thanks a lot! This even works for REST requests!