- 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:44 AM
Hi Gulzar,
Please check your Query business rules on SYS_USER.
Most likely there is one that will prohibit the display of inactive users.
But, please note, that changing that will cause other issues with OOTB behavior and not only.
Hope this helps,
Tudor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 01:40 AM
Have you set he reference qualifier to activeANYTHING on your reference variable?
This may help: https://community.servicenow.com/community?id=community_question&sys_id=e62347e1dbd8dbc01dcaf3231f96...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 01:56 AM
- 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 03:37 AM
Hi Kev,
Thanks again for your response. Well, I must say half of the work is done 🙂
I hope this change won't affect any other reference field pointing to Users table.
Secondly, this field is showing inactive users now when non-admin users search for the same, however, I have a catalog client script that shows alert message when an inactive user is chosen in this field. That alert message pops up for admins but it is not coming up for non-admin users. Could you please guide me if I need to make any change in the catalog client script/script include as well?
Thanks & Regards,
Gulzar Manuja