- 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-16-2022 01:44 PM
Hi Aidy,
Yes, we have had to do so quite a few times for customers and different business requirements. You can modify the OOB (I'd copy the OOB one to modify it, then just deactivate the OOB version) code to meet your needs.
Below is one example.
(function executeRule(current, previous /*null when async*/) {
var url = GlideTransaction.get().getRequest().getHeader("referer");
//If not redirected from the XXXX record producer and not admin nor hr agent - only see active users
if ((url.indexOf('<insert sys_id of record producer that should allow inactive users to be seen>') < 0) {
if (!gs.hasRole("admin") && (!gs.hasRole("hr_basic")) {
current.addQuery("active", "true");
}
}
//Else, it is from the XXXX record producer, so users can see active and inactive users, regardless of current user's role
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 03:30 AM
I'd considered this as a possible solution, but the Global BRs are under the control of the overall platform team and there will be mountains of red tape to cut through to get this changed.
It's a genuine solution as does exactly what we need, so thank you for your quick response - I've tested this and it works perfectly.
I was hoping there would be a way to avoid any overlap between HRSD and ITSM, but alas, there probably isn't.
Thanks again,
Aidy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 03:13 PM
You can only select an active user in Subject Person field of HR case form because of its reference qualifier configuration like below. not due to user table "user query" BR.
A way around is to create one custom field such as: Nonactive Subject Person field, which only display all nonactive users. This field can be displayed for one particular HR service. When this field is displayed, you can hide OOB Subject Person field, otherwise you can hide the Nonactive Subject Person field when OOB Subject Person field is required.
If my reply is Helpful/Correct, please mark the answer as Helpful/Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 03:38 AM
Unfortunately the BR overrides any reference qualifier - I have a dictionary override on this field, however the BR concatenates my query with active=true, which I validated this through debugging.
Whatever reference qualifier I used (whether in the dictionary or script include function), the encoded query that was actually being executed was always suffixed with active=true.