How to show a choice list option only to one group and for rest groups remove that option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 11:49 AM
Hi All,
How to show a choice list option only to one group and for rest groups remove that option. I did tried by using display BR and client script still getting result, let me know if anything wrong in my script
display business rule:-
Table= sc_cat_item
g_scratchpad.grp = gs.getUser().isMemberOf('grp1' || 'grp2');
Onload Client script:-
Table= sc_cat_item
function onLoad() {
if (!g_scratchpad.grp)
{
g_form.removeOption('field_name', 'option');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 11:52 AM
Hi Priya,
Try below
Table= sc_cat_item
g_scratchpad.grp = gs.getUser().isMemberOf('grp1');
g_scratchpad.grp2 = gs.getUser().isMemberOf('grp2');
Onload Client script:-
Table= sc_cat_item
function onLoad() {
if (!g_scratchpad.grp && !g_scratchpad.grp2)
{
g_form.removeOption('field_name', 'option');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 12:00 PM
Hello
You can use the below
if(gs.getUser().isMemberOf('ABC') || gs.getUser().isMemberOf('XYZ'))
{
g_scratchpad.member = true;
}
else
{
g_scratchpad.member = false;
}
And OnLoad client script:
if (g_scratchpad.member== true)
{
g_form.removeOption('fieldname', 'VALUE_TO_REMOVE');
}
Please mark answer correct/helpful based on impact