- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 05:38 AM
Hi, We have a requirement on Query Business rule.
Lets say i have a table 'TABLE' with reference field A. Also lets say, A would refer to records X and Y. Now our requirement is to run a query business rule on 'TABLE' that returns all the records where A is X. And for the records where A is Y, we need to add a query. In simple terms we need (unqueried (A=X)) UNION (queried (A=Y)).
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:03 AM
Hi,
I think you are trying something like this
(A==X) or (A==Y and B==Z)
Field A can be X. If field A is Y then field B should be Z.
There is no direct encoded query for the above. So, I'm applying math here. The above condition can be converted to this
(A==X or A==Y) and (A==X or B==Z)
So, you can try below encoded query
A=X^ORA=Y^A=X^ORB=Z
Thank you,
Palani
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:03 AM
Hi,
I think you are trying something like this
(A==X) or (A==Y and B==Z)
Field A can be X. If field A is Y then field B should be Z.
There is no direct encoded query for the above. So, I'm applying math here. The above condition can be converted to this
(A==X or A==Y) and (A==X or B==Z)
So, you can try below encoded query
A=X^ORA=Y^A=X^ORB=Z
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 06:36 AM
Hi,
This works. I used something like
q=current.addQuery('A',"!=",'X')
q.addOrCondition('A','=','X').addCondition('B','Z');
Thanks.