function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
YourApexGuyYourApexGuy 

Dynamic Criteria Evaluation Possible?

I'm trying to store some rules in a custom object to be evaluated at runtime. So for an Account object one of the rules might be:

Type == 'Customer'

So during runtime I want to evaluate the current Account object and do something like:

String condition1 = 'Type == \'Customer\''; // would get this from the custom object instead of hardcoding

if (condition1) {
// perform some action
}

I don't think this is possible since it is not an actual boolean expression but is there an alternative method or can I build some sort of expression that will be evaluated as t/f?

Scott