Loading
Ongoing maintenance for Salesforce HelpRead More
Business Rules Engine
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
          Runtime Behavior of Local List Variables

          Runtime Behavior of Local List Variables

          The runtime behavior of local list variables deviates from standard context attribute execution when dealing with hierarchical parent-child relationships.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled

          Take a sample context definition with the following hierarchy:

          Country <Context node>

          • countryName <Context attribute>
          • state <Context node>
            • stateName <Context attribute>
            • city <Context node>
              • cityName <Context attribute>
              • cityPopulation <Context attribute>
              • cityType <Context attribute>
              • localCityName <Local list attribute>
            -

          Say that you hydrate this context definition with 3 records for Country, 5 records for State in each country, and 10 records for City in each state. For example,

          • Country: USA, India, Canada

          • Under the country = USA, we have 5 States: California, Texas, New York.. and so on.

          • Under the State = California, we have 10 cities: Los Angeles, San Diego, San Jose.. and so on.

          Standard Context Execution

          When you equate a higher-level parent attribute (such as countryName) to a lower-level context attribute (such as cityName), the parent data is replicated to match the child’s record count to ensure every row has a value.

          For example, in the expression set if we add a calculation step “countryName = cityName”, The cityName attribute will have 150 records.

          • "USA" is assigned to the first 50 cityName records.

          • "India" is assigned to the next 50 cityName records.

          • "Canada" is assigned to the final 50 cityName records.

          Local List Variable Execution

          If you equate that same parent context tag (countryName) to a lower-level local list variable (localCityName), the variable maintains the cardinality of the parent node only.

          For example, in the expression set if we add a calculation step “countryName = localCityName”, The localCityName variable will have 3 records - USA, India, Canada.

          Note
          Note

          When you equate two attributes that belong to the same node (siblings), both standard context execution and local list variable runtime behave identically because they share the same cardinality. For example, in the expression set if we add a calculation step “cityName = cityType” , the cityType context attribute will have 150 records. Similarly if we add a calculation step “cityName = localCityName” , the localCityName local list variable will have 150 records.

           
          Loading
          Salesforce Help | Article