Reference to sys_user only active users for all fields

Henrik Jutterst
Tera Guru

Hello community!

 

Is there a way to only reference active users in ServiceNow from the GUI? I recently saw that we had some duplicate users based on email address. I then updated the duplicate email address and set the active flag to false.

For example. In an incident form I should only be able to search for users that have the active flag to true in sys_user table.

Can this be set on a global level somewhere in a properties file so I don't have to edit all the forms that have reference to sys_user table.

 

Kind regards

/Henrik

1 ACCEPTED SOLUTION

Hi Henrik,

 

Above script is an out of box script which will display only active user records for non-admins.

 

Regards,

Ram M

View solution in original post

8 REPLIES 8

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

The only global way to do this would be a query business rule on the sys_user table.  There is one called "user query" out of the box that does filter inactive users for users that don't have the admin role.  Make sure that business rule is active and test with an ID that doesn't have the admin role.

Thanks! 

As far as now this only states:

current.addActiveQuery();

 

What should it state?

Hi Henrik,

 

Above script is an out of box script which will display only active user records for non-admins.

 

Regards,

Ram M

Thanks, I just found that out myself. And since I'm an admin this would only concern me.

I guess that's good enough since normal users aren't admins.