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

Rule Engine

Hi All,


I have a requirement to create Rule Engine, we have created a set of rules and stored in an object. Each rule will have some Rule Criteria and Rule result (Child objects of rule object). 


whenever i tried to update an Account. That record should go through all the rules and compared with all rule criteria.Each rule criteria will have some conditions. if all the rule criteria's are satisfied, we need to update a field in account object by rule result.


To accomplish this requirement,


I have created Three objects,


Rule-Master object

Rule Criteria - Child object

Rule Result - Child object.


Whenever i tried to update one record, trigger will call this method and loop through all the rules, rule criteria and update rule result value on the field.


Currently it is working. but we may hit some performance issue in future, because using "for loop" we going though Rule then looping all the Rule Criteria then looping though all the Rule results.


Please let me know, If you have any idea to complete this requirement in simple way.



Thanks in advance :)

Not sure if you figured this out yet, but we have built a rules engine app - called BREeze - that is essentailly a VF based rules engine. We've optimized it quite a bit to fit within the salesforce governor limits - even for processing 1,000+ rules. For more information check out: (" target="_blank)