- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 04:58 AM
Hello Team,
I want to hide particular RITMs created from the specific catalog item using the Query Business rule for all users and it shows visible to only specific Groups
I created a Business rule But it's not working as expected, Still, non-specified group members see that RITM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:22 AM - edited 05-03-2023 06:23 AM
Try this
(function executeRule(current, previous /*null when async*/ ) {
if (!(gs.getUser().isMemberOf('7547606d879e4d1080bba8a90cbb3595') || gs.getUser().isMemberOf('2dd2fa7f87922d50a4a486e40cbb3589'))) {
current.addEncodedQuery('cat_item!=858476ff87922d50a4a486e40cbb3571');
}
})(current, previous);
Also, once you get the script working, try to avoid the hardcoded sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:22 AM - edited 05-03-2023 06:23 AM
Try this
(function executeRule(current, previous /*null when async*/ ) {
if (!(gs.getUser().isMemberOf('7547606d879e4d1080bba8a90cbb3595') || gs.getUser().isMemberOf('2dd2fa7f87922d50a4a486e40cbb3589'))) {
current.addEncodedQuery('cat_item!=858476ff87922d50a4a486e40cbb3571');
}
})(current, previous);
Also, once you get the script working, try to avoid the hardcoded sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 10:50 PM
I don't know why but this not working for me is it something OOB ACL that we need to modify?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:26 AM
Hello Aparna,
Change the code like below and try.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if ((!gs.getUser().isMemberOf('7547606d879e4d1080bba8a90cbb3595')) && (!gs.getUser().isMemberOf('2dd2fa7f87922d50a4a486e40cbb3589'))) {
current.addEncodedQuery('cat_item!=858476ff87922d50a4a486e40cbb3571');
}
})(current, previous);
Regards,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 01:16 AM
When I write a before Query business rule on RITM record then it stops the RITM record creation as well