
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2018 06:46 AM
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
Solved! Go to Solution.
- Labels:
-
User Experience and Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2018 07:16 AM
Hi Henrik,
Above script is an out of box script which will display only active user records for non-admins.
Regards,
Ram M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2018 07:25 AM
Hi Henrik,
If you don't want the active users to be displayed for admins as well then you can remove the below condition from the condition field
&& !gs.hasRole("admin")
But issue is that you will not be able to see the inactive records in case of any debugging to be done for inactive accounts.
Regards,
Ram M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2018 07:19 AM
I would suggest not doing it on a global way as you are trying, instead on the incident form you use a reference qualified to query only active records.
If you do it on a global level you will have to add exceptions everything someone needs to look at the inactive records(report, audits etc).
Generally as a good practice also for querying any query we try and add active clause to get smaller and refined record set, user or any other table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 03:57 PM
how would you find all the places that the sys_user table is referenced? Incident, request, etc....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 12:16 AM
One way could be Dictionary.
Type Reference and referenced table :- User
This is an old thread, haven't checked the whole thing 🙂