
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 11:54 AM
We have a custom field, Subcontractor (u_subcontractor), on the sys_user table, which is selected if the user is a subcontractor vs employee. Once the subcontractor's contract is up and finished with their active project, we unselect the "active" flag for that user. We have a specific Service Request Catalog for hiring approved (previously used) subcontractors. The field in the catalog is a reference field back to the sys_user table, with the reference qualifier of "Subcontractor is true". The problem I'm encountering is when managers or PMs go to the catalog to select an approved subcontractor, they only see the active subcontractors (need to see them all) - due to the "user query" Business Rule. There isn't any specific role for the possible users that could be entering the request for me to add to the business rule. I haven't been able to find a way within that business rule to make sure we aren't in the catalog or specific variable before applying the addActiveQuery. Updating the variable's reference qualifier to include "active = false" does not help. Has anyone been able to handle this type of situation before?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 08:59 PM
The reference qualifier won't help because the user query Business Rule is still invoked when searching or clicking the magnifying glass.
If allowing the Users to be searched from all reference fields pointing to sys_user isn't a problem, you should be able to modify the business rule from current.addActiveQuery() to current.addActiveQuery().addOrCondition("u_subcontractor", true);
(Assuming u_subcontractor is the name of the field)
Alternatively you can copy the business rule, mark the original as inactive and change the code so you don't own the OOB rule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 08:59 PM
The reference qualifier won't help because the user query Business Rule is still invoked when searching or clicking the magnifying glass.
If allowing the Users to be searched from all reference fields pointing to sys_user isn't a problem, you should be able to modify the business rule from current.addActiveQuery() to current.addActiveQuery().addOrCondition("u_subcontractor", true);
(Assuming u_subcontractor is the name of the field)
Alternatively you can copy the business rule, mark the original as inactive and change the code so you don't own the OOB rule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 10:03 AM
Thank you! Using current.addActiveQuery().addOrCondition("u_subcontractor", true); worked perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2015 12:08 PM
Mark,
We have a similar issue where we would like users to be able to select inactive groups in a catalog item. I could not find a condition to reference the session table the user is on. Any ideas?