dynamic filter with addOrCondition not working in query business rule.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 02:14 AM - edited 07-24-2023 02:20 AM
Hello Folks,
We have a scenario - Chang Task assignment group members should be able to see the linked Change request.
For this I have created Task groups field with glide list type on Change request form, and added the task assignment groups to the Task groups field by using script.
I have written a below Query BR on change request table:
var userID = gs.getUserID();
var qc = current.addQuery("requested_by", userID).addOrCondition("watch_list", "CONTAINS", userID).addOrCondition("work_notes_list", "CONTAINS", userID);
if (gs.hasRole("change_builder")){
qc.addOrCondition('u_task_groupsDYNAMICd6435e965f510100a9ad2572f2b47704');
}
Unfortunately, the below condition (dynamic filter) is not working in the query br.
qc.addOrCondition('u_task_groupsDYNAMICd6435e965f510100a9ad2572f2b47704');
If we put the below condition only in the Query BR, it's working fine.
var qc = current.addQuery('u_task_groupsDYNAMICd6435e965f510100a9ad2572f2b47704');
Please help me to fix the issue.
Thanks,
Raj
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 02:25 AM
Hi @Raj90 ,
Try with
current.addEncodedQuery('requested_by='+userID+'^ORwatch_listLIKE'+userID+'^ORwork_notes_listLIKE'+userID);
Please mark my response correct/helpful as applicable!
Thanks and Regards,
Rahul
Thanks and Regards,
Rahul