Before Query Business Rule is not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:11 AM
HI,
I am trying to restrict the incident records, when the user is tick on the check box 'Visible to HRIS team' and should be part of any of two assignment groups "HRIS - Workday Support" and "HRIS - iCIMS Support" .
Below is the Business Rule Written but it is not working.
(function executeRule(current, previous /*null when async*/) {
visible= current.u_visible_to_hris_team;
if(visible=='true'){
if(gs.getUser().isMemberOf('HRIS - Workday Support')) {
current.addQuery('assignment_group.name','HRIS - Workday Support');
}
else if (gs.getUser().isMemberOf('HRIS - iCIMS Support')){
current.addQuery('assignment_group.name','HRIS - iCIMS Support');
}
}
})(current, previous);
Note: The Business Rule is working if we remove the Check box condition "if(visible=='true')" , Please help me how should it make it work for Check box True condition.
11 REPLIES 11
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 04:08 AM
you cannot access field value inside Query Business rule
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 03:36 AM
HI,
Can any one help me how to acheive the requirement.