- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:15 PM
There is a global business rule (user query) which filters out inactive users on the sys_user table using current.addActiveQuery(); for non admins.
One of our HR services is to raise a case for leavers (within the past 12 months), however there is no way to populate these users in the subject_person field (which is a reference field to the sys_user table) within a HR case as any reference qualifier is always suffixed with active=true, filtering out the users needed for selection.
This also is an issue with passing the user from a record producer variable - the inserted record's subject_person is empty.
We want to avoid touching the global BR as we only want it to be skipped/bypassed for one particular HR service.
Does anyone else have HR services covering inactive users and is there a way around this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 10:01 AM
Hi,
Best of luck, haha!
If my reply ends up guiding you Correctly, please also mark it as Correct.
Take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 07:29 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 07:04 AM
Hello,
Since you had called out you didn't want to adjust the global "user query" business rule, I had refrained from responding and was waiting to see what others would come up with.
Unfortunately, since the query BR will intercept and apply the added query, there really isn't a way to get around this without editing it.
You also wouldn't need extensive code to be added to it if you were wanting this to scale (for the platform)
With that said, the common solution I've proposed is to include this small if statement to the current out of box user query business rule script:
var query = current.getEncodedQuery();
if (gs.getSession().isInteractive() && !query.includes('activeANYTHING')) {
//do x (aka your out of box code)
}
So this would allow for any reference qualifier for the sys_user table to simply included, somewhere, "activeANYTHING" and if that is listed, then the user query script, where it appends the active=true, wouldn't apply.
This is useful across the platform .
So while it does have some red tape to go through in your case, you're proposing a scalable solution that others can use, if needed, and shouldn't lead to technical debt.
I would also advise that this change be made on the out of box user query business rule. This allows for it to be reviewed during upgrade and can be assessed if it's still needed, etc.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 08:37 AM
I'm going to go and do some 'fiddling' with this idea - I see a wealth of possibilities with this approach.
As you mention, it's useful across the platform and our ITSM team would prefer not to have to login with their admin accounts, just to see inactive users.
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 10:01 AM
Hi,
Best of luck, haha!
If my reply ends up guiding you Correctly, please also mark it as Correct.
Take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!