- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 12:30 PM
Hello all,
I have created a custom field on change request form, "CAB Approvers".
So, using a business rule when the state moves to Cab review, I am populating the approval groups sys_ids into that custom field.
Now, I want to check if the logged in user is member of one of those groups, in client script.
Can someone please give me script how to achieve this?
Regards,
Lucky
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 02:20 PM
Please try this:
var arrGroups = current.CUSTOM_FIELD.toString().split(","); //Replace CUSTOM_FIELD with your custom field name
for (var i = 0; i < arrGroups.length; i++) {
var group = arrGroups[i].trim();
if (gs.getUser().isMemberOf(group)) {
g_scratchpad.memberofcab = "true";
return;
}
}
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 02:20 PM
Please try this:
var arrGroups = current.CUSTOM_FIELD.toString().split(","); //Replace CUSTOM_FIELD with your custom field name
for (var i = 0; i < arrGroups.length; i++) {
var group = arrGroups[i].trim();
if (gs.getUser().isMemberOf(group)) {
g_scratchpad.memberofcab = "true";
return;
}
}
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 02:40 PM
Thank you Medi,
It's working.
Great!!!!!!
Regards,
Lucky