- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2020 11:34 PM
Ist that Possible?
check();
function check() {
var gr = new GlideRecord("hr_case");
gr.addActiveQuery();
gr.addQuery('parent.template', '16c971f9db58ec14066c4f63059619b8');
gr.query();
gr.next();
gs.info(gr.parent.template);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2020 01:28 AM
check();
function check() {
var gr = new GlideRecord("hr_case");
gr.addActiveQuery();
gr.addQuery('parent.ref_sm_order.template', '16c971f9db58ec14066c4f63059619b8');
gr.query();
gr.next();
gs.log(gr.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2020 01:28 AM
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2020 01:31 AM
Reason being
1) parent field on HR Case refers to task table
2) the template field is present on sn_hr_core_case table so you cannot dot walk in the query
If you try to form the query from the filter it won't show the template field as well
Regards
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-16-2020 01:23 AM
From which scope you are running this.
Also did you check the HR case is active
Regards
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-15-2020 11:50 PM
You can use Background scripts to test it .
I also see you are using table as hr_case, are you using legacy HR Application ?
Regards
Pranav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2020 11:52 PM
Hi,
Is that HR Case Active?
Is the Parent HR Case for this case has template populated or not
Also from which scope you are running this script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader