+ Start a Discussion

Dynamic Logical Operations

Hi friends,

I have a requiremnt like,

there are 2 objects




And CN has a Lookup relationship with BR


Each BR may have more than one CNs;

On BR object one of the field will have some logic like below,

1 OR (2 AND 3)



1, 2 and 3 are the CN records say some condition records

each condition record will have 3 fields like below,

Field Name              Operator                      Value

Status                        equals                         New


Now I need to perform validations from Apex.

Can someone help me ?

Thanks in advance.




Best Answer chosen by Admin (Salesforce Developers) 

I got it,

Thanks for your support

All Answers

If i have understood your requirements correctly, I dont think this is possible in Apex.
This involves parsing the logic in the BR Object. Parsing in itself is a complex subject. Also you have to take care of errors, What if there is a syntax error like missing parenthesis. And then you have to take care of precedence for complex logic involving many nested parenthesis.

Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

I got it,

Thanks for your support

This was selected as the best answer