- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 07:27 AM - edited 12-15-2023 05:16 AM
Hi everyone,
I need help with a advanced reference qualifier.
If logged in user belong to a group which name start with "SN-CC" then he should see only his groups he belongs to + the one exception group with sys_id xyz.
All other logged in user which not belongs to a group which name start with "SN-CC" then he should see all assingment groups.
Thanks for help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 01:35 AM
Hello @JohnDF ,
Does this resolved your issue?? If yes, Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 08:10 AM
Hi @JohnDF, You can put the log statements inside the script include function like below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 08:04 AM
Hello @JohnDF ,
Write before query business rule on "sys_user_group" table and write the code like below.
(function executeRule(current, previous /*null when async*/ ) {
var bl = false;
var loggedInUser = gs.getUserID();
var group = new GlideRecord('sys_user_grmember');
group.addQuery('user', loggedInUser);
group.addEncodedQuery("group.nameSTARTSWITHSN-CC");
group.query();
if (group.next()) {
bl = true;
}
if (bl == true)
{
current.addEncodedQuery("sys_idINjavascript:gs.getUser().getMyGroups();^ORsys_id=group_sys_id");
}
})(current, previous);
Please mark my answer as correct and helpful if it helps to resolve your issue.
Regards,
Namrata