Hi All, I need a before query business rule that checks for a group membership of the currently logged-in User and returns some filtered/queried records from the sys_user_group table (having u_hidden value as true)?

Koushik Ningara
Tera Contributor

Need a before Query business rule which checks for a group membership of the currently logged-in User and returns some filtered records from sys_user_group table having field value Hidden=true.

1 ACCEPTED SOLUTION

Meera11
ServiceNow Employee
ServiceNow Employee

if(gs.getUser().isMemberOf(current.assignment_group)){

var gr = new GlideRecord("sys_user_group");

gr.addEncodedQuery("u_hidden=true") // copy query link from sys_user_group_table 

gr.query();

{

 

add remaining logic

}

}

 

Mark Correct/ helpful if this helped you

View solution in original post

10 REPLIES 10

Koushik Ningara
Tera Contributor

That assignment group is "External Vendors", should I add in-place of current.assignment_group??