- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 09:42 AM
I am struggling to get dot walking in a query business rule.
For a given role, I'm trying to show only HR tasks when the parent.hr_service cases is a desired Service.
This is a little example of the syntax I tried but it doesn't appear to work in a query business rule. <sys_id> in my query is actually the sys_id of the HR Service.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 10:54 AM
Dot-walking doesn't seem to work, at least in this case. Here's a workaround for the Query Business Rule script:
function executeRule(current, previous /*null when async*/) {
var resultsArr = [];
var parGr = new GlideRecord('sn_hr_core_task');
parGr.query();
while (parGr.next()) {
if (parGr.parent.hr_service == '9e28cde49f331200d9011977677fcf00') {
resultsArr.push(parGr.sys_id.toString());
}
}
current.addQuery('sys_id', 'IN', resultsArr.join(','));
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 12:10 PM
The dot walking didn't work in hr application. I tried that but maybe it is only HR, that didn't work.