- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2014 01:02 PM
I have a variable set that includes a reference to User [sys_user]. I would like to list all users (active and not active) on certain Configuration Items. The default is to only display active. How do I code to include all users?
By the way, when I'm logged in as admin, I can see all users regardless as to whether the records are active or not, but as a normal user, just active users show on the list.
I tried to add the below code to the onLoad Script, but it doesn't work.
var guidename = g_form.getValue('name');
if(guidename == 'MW Termination'){
g_form.refQual('requested_for','active in (true,false)');
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2014 01:56 PM
Hi Eric,
As Kalaiarasan P said, there is a Before "Query" business rule called "user query" with the following code:
current.addActiveQuery();
This is a standard BR created by ServiceNow, and it should not be modified, else it will be excluded from future upgrades. I recommend marking it inactive (Active=false), and then copying the BR and modifying it to suit your purpose (you could add an additional gs.hasRole("xxx") condition if your intended users have a specific role). Otherwise, if you want end users (ESS) to see all users, you would just need to deactivate the BR.
Regards,
Jake

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2014 06:11 PM
There is a display business rule on sys_user table that removes the inactive user. You would need to Change that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2014 06:15 PM
this BR "user query"....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2014 01:56 PM
Hi Eric,
As Kalaiarasan P said, there is a Before "Query" business rule called "user query" with the following code:
current.addActiveQuery();
This is a standard BR created by ServiceNow, and it should not be modified, else it will be excluded from future upgrades. I recommend marking it inactive (Active=false), and then copying the BR and modifying it to suit your purpose (you could add an additional gs.hasRole("xxx") condition if your intended users have a specific role). Otherwise, if you want end users (ESS) to see all users, you would just need to deactivate the BR.
Regards,
Jake
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2014 10:02 AM
Thanks Jake. That's what I'm looking for . I appreciate the warning on how my changing this will be overwritten next update.