Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Get Started with Communications, Media, and Energy & Utilities (CME)...
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Expression Modes and Custom Expressions

          Expression Modes and Custom Expressions

          When a rule set contains more than one child context rule, you must use the expression mode to specify how the rules engine combines the child rules into a logical expression.

          The possible expression modes are:

          • And (the default): Requires that all of the child rules in the rule set pass for the rule set to pass. If one child rule fails, the rule set fails. Used only with qualification rules.

          • Or: Requires that only one of the child rules in the rule set passes for the rule set to pass. If one child rule passes, the rule set passes. Used only with qualification rules.

          • Custom: Uses a custom logical expression defined in the Expression property to evaluate the rule set. Used only with qualification rules. See Custom Expression Definition for more information.

          • If Else If: Evaluates the first child rule in the rule set and if it does not pass, continues to subsequent children rules in the sequence. After a rule passes, it stops processing. The best practice is to set the last rule to always be true, creating a fallback action. Used with penalty rules to apply different penalty amounts using context actions.

          • If: Evaluates the first child rule in the rule set. If it does not pass, continues to evaluate all subsequent child rules in sequence. Continues to process until all child rules are processed. Used with penalty rules, when more than one penalty may be applied.

          Expression Mode settings of If Else If and If are described in the preceding text.
          Note
          Note While creating rules with custom expressions, make sure that rule names aren’t subsets or supersets of each other.

          Custom Expression Definition

          When the Expression Mode is set to Custom, you can create a custom logical expression that the rules engine uses to evaluate the children rules. You enter the custom expression in the Expression property in the rule set.

          When writing the custom expression, use the following syntax rules:

          • Use AND and OR operators only.

          • Refer to child context rules using rule codes.

          • Use spaces to delimit each expression element.

          • Use parentheses to sequence order of operations for the expression.

          • Expressions are case-sensitive.

          The following are some example expressions:

          ( Rule1Code OR Rule2Code )
          ( ( Rule1Code AND Rule2Code ) OR ( Rule3Code AND Rule4Code ) )
          ( ( Rule1Code OR Rule2Code ) AND ( Rule3Code ) AND ( Rule4Code ) )
           
          Loading
          Salesforce Help | Article