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
Jacob W LandisJacob W Landis 

How to valid a logic string

Hi,

We want to display a list of string ( from a object) to let user pick, after they pick some values, for example A, B , C and D, and then user can put some logic for the selection, like (A and B) OR (C and D). My questions are
1. how to valid this logic string?
2. We are going to have a conjunction object to hold the relationship between selectd item with parent, how can we store this logic information?

Thanks,

Jingli
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Jingi, 

Please, have a look at "Composite" design pattern. THis is design patterns has been designed for this purpose -

Here is the link -

https://developer.salesforce.com/page/Apex_Design_Patterns

Thanks, 
Sumit Kumar Singh
Jacob W LandisJacob W Landis
Thanks for the response. My question is how to valid a text which has and/ or logic between selected items. for example (1 or 2) and (3 or 4)
 
Jacob W LandisJacob W Landis
actually the pattern could be like ((A=1) And B ) OR (c=2)