A Summary Variable in Salesforce CPQ lets you calculate and summarize data from the line items in a quote. It helps you get important information like total quantities, prices, or custom calculations.
How It Works:
You define a Summary Variable by giving it a name, a data type, and a formula or initial value that tells it what to calculate.
For example, you could have a variable called Total Items that sum up the quantity of all items in the quote.
These variables can be set to apply across the whole quote, to specific groups of items, or individual items.
About Me
Hello, my name is Smriti Sharan. I am an avid blogger and YouTuber. Follow my Blog, Linkedin, and YouTube to learn various aspects of Salesforce.
https://t.me/sfdcamplified feel free to join the telegram group.
Follow my Youtube
Use Case: Ensure that for any T-Mobile Data Plan and T-Mobile SIM Card products, the combined total quantity does not exceed 3.
Step 1: Create the Validation Product Rule
Product Rule Name: Max Quantity Validation for T-Mobile Products
Type: Validation (Ensures the rule prevents saving the quote if conditions are not met)
Scope: Quote (Applies the rule to the entire quote)
Conditions Met: All (Specifies that all conditions must be met for the rule to trigger)
Evaluation Event: Save (Determines that the rule is checked when the quote is being saved)
Message: The total quantity for T-Mobile Data Plan and T-Mobile SIM Card cannot exceed 3.
Active: Check this box to activate the rule.
3. Save the Record.
Step 2: Create a Summary Variable to Count the Total Quantity
Click on the New Summary Variable Button under Error Conditions.
Variable Name: Total T-Mobile Quantity
Aggregate Function: Count (Counts the number of line items)
Target Object: Quote Line (Defines that the variable will calculate based on quote line items)
Aggregate Field: Quantity (The field to be aggregated)
3. Save the Record.
Step 3: Add Error Condition to Use the Summary Variable
Click on New under Error Conditions.
Rule: Max Quantity Validation for c Products
Index: 20 (This condition should be evaluated before the previous one)
Tested Variable: Total T-Mobile Quantity (Select the summary variable you just created)
Operator: Greater than
Filter Type: Value
Filter Value: 3 (Sets the maximum quantity threshold to 3)
Save the Record.
Step 4: Test the Configuration
- Create a Quote under that opportunity.
- Add products T-Mobile Data Plan and T-Mobile SIM Card.
- Set values for the products that exceed a total of 3.
- Click on Save: You should see an error message preventing the quote from being saved due to exceeding the allowed total quantity.