
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:03 AM
I have an item in the catalog where I need the end users to be able to select disabled user records.
We currently have the typical before query business rule that limits those disabled records to HR and the Service Desk roles.
I still want to limit to only active users everywhere else. The only exception is this variable.
Is there a way I can avoid running this BR?
I was thinking a script include for an advanced ref qualifier, but I assume that still would trigger that BR.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2018 07:04 AM
Hi Shill,
I've recently encountered the same situation. I solved the problem by setting the reference qualifier on the variable to "activeANYTHING". Inside the "User Query" business rule I do something similar to:
var query = current.getEncodedQuery()
if( gs.getSession().isInteractive() && !query.includes('activeANYTHING') )
current.addActiveQuery()
Hope this helps you or others. Same idea can be used to bypass other query rules.
Ryan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 09:02 AM
That would work, but unfortunately this needs to be available to ALL users.
Giving roles to end users would increase our license count.
That would also force those in that role to have the ability to select disabled for all user reference fields, which I am trying to prevent, if anything, to avoid the clutter in the autocomplete or reference lists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 09:30 AM
Steve Hill wrote:
That would work, but unfortunately this needs to be available to ALL users.
Okay, so... removing the admin check in the BR ought to do the trick. Just worried it may have quite a wide blast radius.
Giving roles to end users would increase our license count.
Is this right? I thought only specific roles were licenced - didn't think custom roles counted, since you'd then be charged for every new table created with roles created by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2018 07:04 AM
Hi Shill,
I've recently encountered the same situation. I solved the problem by setting the reference qualifier on the variable to "activeANYTHING". Inside the "User Query" business rule I do something similar to:
var query = current.getEncodedQuery()
if( gs.getSession().isInteractive() && !query.includes('activeANYTHING') )
current.addActiveQuery()
Hope this helps you or others. Same idea can be used to bypass other query rules.
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2019 08:03 AM
Ryan,
I have a similar issue, and I really like your idea, as it just makes the exception for that particular catalog item/variable and nothing else. However, I am already using the Reference Qualifier for an Advanced Filter:
manager=javascript:gs.getUserID()
Basically, the managers submitting this request should only see employees who report to them (whether active or not).
Is there a way to incorporate both things in my Reference Qualifier?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2019 09:38 AM
OK, the light bulb went on and I figured it out.
Just changed this part:
... && !query.includes('activeANYTHING'))
to this:
... && !query.includes('manager=javascript:gs.getUserID()'))
and it worked!