
- 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 07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 07:27 AM
You could disable the BR so it's never run.
Then consider another BR that runs only for situations that don't meet your criteria.
However, BRs exist for a purpose - perhaps more clarification is needed about why this BR runs, and if disabling it is a good idea.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 08:26 AM
This is the baseline 'User Query' business rule on the user table.
This prevents selection of disabled users on all user references in the system unless you are an admin.
In my use case, I need to allow the selection of disabled users by another end user (not just an admin) specifically in one location (a catalog item variable).
Disabling is not an option.
The only realistic option I feel is to somehow exclude this from running on this one reference to the user table.
Just not sure how I might be able to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 08:51 AM
At a quick glance, I'd consider:
- create a new role that permits selection of disabled users - possibly called "disable_bypass" or something. (I'd avoid any mention of "admin" in the name)
- copy the BR and disable it
- amend the new BR and include that role in the bypass check.
- activate this BR!
- create two test users - one with and one without. Check functionality only works on the right one.
- create a group with this role, then add your specific user(s) to this group to permit disabled user selection
- inform them that they now have the right to select disabled users
- inform them that they need to log out and back in to pick up new group membership (and therefore roles)
- PROFIT!