Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to make inactive user visible for non-itil users.

Puneet4418
Tera Contributor

Hi,

how can I make inactive user visible for non-itil users under a reference field of a particular catalog item. 

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

These likely can't be seen due to a before Query Business Rule on the sys_user table.  If you have this, change the script to:

function executeRule(current, previous /*null when async*/) {
	var query = current.getEncodedQuery()
	if (gs.getSession().isInteractive() && !query.includes('activeANYTHING')) {
		current.addActiveQuery();
	}
})(current, previous);

where you probably just have the addActiveQuery line now.

On the reference variable for the particular Catalog Item, and any similar cases that follow, add to the advanced reference qualifier:

activeANYTHING

preceding it with a ^ for AND if you already have something there.

 

Anand Kumar P
Giga Patron

Hi @Puneet4418 ,

Go to business rules and search with name “user query” you follow steps suggested by Brad.

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand