- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2019 10:52 AM
Below condition works only if current user is member of each group selected. I am looking for a condition where current user is member of only 1 of the selected groups.
gs.hasRole(DemandUtil.getDemandRole('manager',current.getTableName())) && current.state == 1 && gs.getUser().isMemberOf(current.getValue("u_new_function"))
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2019 10:44 PM
Here is the script include which you can use.
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {
checkUser: function(groups){
//assuming groups are passed as a string with comma separated.
var groups_arr = groups.split(",");
for(i=0;i<groups_arr.length;i++) {
if(gs.getUser().isMemberOf(groups_arr[i])) {
return true;
}
}
return false;
},
type: 'MyScriptInclude'
});
And you can call in your UI action like this.
gs.hasRole(DemandUtil.getDemandRole('manager',current.getTableName())) && current.state == 1 && new MyScriptInclude().checkUser(current.getValue("u_new_function"))
Mark the comment as a correct answer and helpful if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2019 11:23 AM
You would need a script include for that.
There is no OOB function to check that.
In the script, you would need to query the sys_user_grmember table and then return the group id, user belongs to
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2019 10:44 PM
Here is the script include which you can use.
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {
checkUser: function(groups){
//assuming groups are passed as a string with comma separated.
var groups_arr = groups.split(",");
for(i=0;i<groups_arr.length;i++) {
if(gs.getUser().isMemberOf(groups_arr[i])) {
return true;
}
}
return false;
},
type: 'MyScriptInclude'
});
And you can call in your UI action like this.
gs.hasRole(DemandUtil.getDemandRole('manager',current.getTableName())) && current.state == 1 && new MyScriptInclude().checkUser(current.getValue("u_new_function"))
Mark the comment as a correct answer and helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2019 10:56 AM
Thank you for the assistance with this answer. I just had the opportunity to test and verified it does work.
Thank you for helping the community, asifnoor!