How to make a particular choice field only available for particular user group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2024 09:08 PM
I have a requirement in which it has been mentioned that I need to make a choice value named ACB to make available only for User group named Cloud. How to achieve this ? Is it possible using ACL or CLient script ot BR ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2024 05:03 AM
Hi @spimple ,
You can create a Display Business rule to check if the user is a member of the Cloud group, and in a Client Script you can remove the option ACB depending if the user is a member of the group or not.
To do that, first you'll need to create a Business Rule on display on the proper table.
 
In the Advanced tab you'll need a code like this:
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.CurrentMembership = gs.getUser().isMemberOf("Cloud");
})(current, previous);
Now for the Client Script, it should be onLoad
And you for your script you could use something like this:
function onLoad() {
if (g_scratchpad.CurrentMembership == false) {
g_form.removeOption('category', 'ACB'); // here you should add the name of your field instead of category
}
}
If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know
Cheers