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
sharathchandra thukkanisharathchandra thukkani 

Evaluate the string which has criteria in apex

Hello Guys,

I have a string variable for example:

String str = 'Priority==\'xyz\' && Isescalated==true';
I want to execute the above statement in apex by replacing the Priority and Isescalated with record values.

I tried to use tooling API in triggers but i get exception cannot call future method from future. (I solved it by using stopping the recursion) but the record takes some time to reflect the changed owner.

Also i want to know what is the best way to do this. I cant use existing assignment rules as we can have more than 3000 rules setup and we also have to customize the assignment rules to use weightage.

Any suggestions?
PrabhaPrabha
For Issue 1:

Try this:
String var_Pri = 'Priority';
String var_Esc = 'Isescalated';

String str = var_Pri+'==\'xyz\' && '+var_Esc+'==true';

Pls explain more about the issue with tooling API... 

Let me know if it works!!!

PrabhaN