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

Tudor
Tera Guru

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

 

 

Kev9
Kilo Sage

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...

Hi Kev,

Thanks for you response. Currently, this is how Type Specifications look in the variable:

 

find_real_file.png

 

Should I make any changes here ?

Thanks & Regards,

Gulzar Manuja

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

 

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