You need to sign in to do that
Don't have an account?
Want to validate the filter logic.
I am generating the dynamic query in salesforce using the field selected on the vf page.
e.g. 1 Id = 'GHDkmdfjnsdf21'
2 name != 'Test'
3 city = 'pune'
Now i have text box where user can enter his/her logic like 1 AND 2 AND 3 || 1 OR 2 OR 3 so if there is combination of AND/ OR like
1 AND 2 OR 3 then the SOQL query will be wrong correct logic is 1 AND (2 OR 3). so I want to validate this logic.
Thanks in advance.
e.g. 1 Id = 'GHDkmdfjnsdf21'
2 name != 'Test'
3 city = 'pune'
Now i have text box where user can enter his/her logic like 1 AND 2 AND 3 || 1 OR 2 OR 3 so if there is combination of AND/ OR like
1 AND 2 OR 3 then the SOQL query will be wrong correct logic is 1 AND (2 OR 3). so I want to validate this logic.
Thanks in advance.
Find below code according to your requirment.
This code will add brackets '()' if user will enter combination of AND/OR
Hope this will help you
Thanks