- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:40 AM
Hello All,
Hope all of you are doing well.
I have a requirement wherein we would like to show inactive users to the non-admin users in the reference field on a catalog item. As per default behavior of ServiceNow, system does not show inactive users to non-admin users on a catalog item. There is a workaround available for the same in the following link, however, it is not working for me.
https://community.servicenow.com/community?id=community_question&sys_id=3b7d032ddb9cdbc01dcaf3231f96190e
I have modified my query BR as follows wherein I have mentioned sys_id of the catalog item for which I would like to show inactive users to non-admins. Having said that, logic is not working as non-admin users can still search for active users only. Above mentioned community link also states to modify the reference qualifier for this reference field but is it not very much clear what exactly to add in the reference qualifier.
Any help will be highly appreciated.
Thanks & Regards,
Gulzar Manuja
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 02:28 AM
Hi Gulzar,
Did you amend the script in the user query BR to that in the post above?
var query = current.getEncodedQuery()
if( gs.getSession().isInteractive() && !query.includes('activeANYTHING') )
current.addActiveQuery()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:43 AM
Hi,
just use the sysId and don't add the text sys_id=
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 01:01 AM
I added a log inside the if condition to see if the control is going inside if when non-admin user is searching for an inactive user on this catalog item. Ideally, it should not go inside if loop for this catalog item but unfortunately it is going as I can see new entries in the script log statements. I have verified that I am using correct sys_id. Not quite sure what the problem is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 01:59 AM
Hi,
did you check by adding in log what came in current.getEncodedQuery()
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader