Query Business rule not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2022 04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2022 05:32 AM - edited 12-03-2022 05:40 AM
Hi David,
Keep in mind that the Condition is going to cause the BR/script to run only if the current user is not a member of that group, so all RITMS will be shown to members of this group. If this is not what you want to do, remove the Condition all-together to start with, or modify it accordingly.
In the script, try something more like this to only show RITMs where the current user is the one who opened it, OR the assignment group is empty OR the assignment group is not the one from the system property - or change this encoded query to whatever you're trying to accomplish:
var u = gs.getUserID();
var grp = gs.getProperty('MyPortal_AssignmentGroup_HRSystem');
var query = 'assignment_groupISEMPTY^NQassignment_group!=' + grp +
'^NQopened_by=' + u;
current.addEncodedQuery(query);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2022 10:49 AM
Thank you Brad for your reply.
I'll try this and will update you here...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 05:36 AM - edited 12-06-2022 05:37 AM
Hello Brad, i have made this changes; This is working for me
var u = gs.getUserID();
var grp = gs.getProperty('MyPortal_AssignmentGrp_HRSystem');
var q = current.addNullQuery('assignment_group');
q.addOrCondition('opened_by', u);
q.addOrCondition('assignment_group', '!=', grp);
gs.log("query restricted to user: " + u);