Reference field does now show inactive users in a catalog item

Gulzar Manuja2
Kilo Guru

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. 

 

find_real_file.png 

 

Any help will be highly appreciated.

 

Thanks & Regards,

Gulzar Manuja

1 ACCEPTED SOLUTION

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()

 

View solution in original post

18 REPLIES 18

Hi @Ankur Bawiskar ,

I have checked it, it is returning -1 due to which it is going inside if loop. This is the URL of my catalog item

find_real_file.png

As I am using the same sys_id in the if condition, not sure why indexOf is returning -1.

Hi,

not in browser

what came in that BR script?

gs.info(current.getEncodedQuery());

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

It's returning sys_id of different users from sys_user table as shown below:

find_real_file.png

nowhere it's showing the sysId of the catalog item?

the solutions have worked in the past; not sure if the latest release lead them to failure

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

That's correct. Can't see sys_id of the catalog item anywhere in the logs. Perhaps they have made some changes in the new release. Thanks for your guidance though.

 

Best Regards,

Gulzar Manuja