I want to show inactive users for 2 fields only of HR form and remaining all fields should contain active users

ravindranath2
Tera Contributor

I am tryig to use 'user query' before business rule, but getting confused how to restrict to 2 fields to show active and inactive users and remaining all fields where we are referring user table should show only active users. please some one help me out here for the solution.

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ravindranath,



You need to create a reference qualifier to restrict the values i.e as per your logic active or inactive for those fields.


http://wiki.servicenow.com/index.php?title=Reference_Qualifiers


Hi Pradeep,



But Before Query business rule i.e. User Query will do the trick to restrict the accessing inactive users for the people other than admin users.



I want some other role users to access inactive users to show up only for 2 fields, but the same role users should not see inactive users for other fields other than these two.


You can do this by writing a script include and in that add role condition .i.e if (gs.hasRole('')) and glide sys_user table and add addActiveQuery else just add addQuery condition. I hope that answers your question.



Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Thanks,
Deepa


Hi Deepa,



As i mentioned, before query business rule is executing over the reference qualifiers,so i want to modify that Business Rule in such a way that it should accessible to only 2 fields of HR form but not anything else.



Thanks,


Ravi.