We recently introduced our new product FHT (Field History Tracking)Application which enables users to track field history of as many fields for an object they want .The object can be standard or custom as per users choice.

Salesforce CPQ’s Product Validation Rule

Generally Product rules are made in Salesforce CPQ to evaluate product options within a bundle, or a quote, or a quote line against some conditions (Error Condition) and if conditions are fulfilled as per Client requirement then perform ‘Actions’ in that response.

Scenario:

Create a Validation Product Rule to Limit the Number of Warranty Product should be Equal to Number of Hardware Product (in our Case CARS, Keys,Toolkits are hardware product in our Bundle)

Step 1: Create a Summary Variable to get Sum of “Hardware (Tata Cars)”

  • Click Summary Variables from the navigation bar.
  • Click New.
  • In the Variable Name field, enter Sum of Hardware (Tata Cars)
  • For the Aggregate Function field, choose Sum.
  • For the Aggregate Field field, choose Quantity.
  • For the Target Object field, choose Product Option
  • For the Filter Field field, choose Product Code.
  • For the Operator field, choose equals.
  • In the Filter Value field, enter HARDWARE.(We have given Product Code as HARDWARE for Hardware Products)
  • Click Save

Step 2: Create another Summary Variable to get Sum of Warranty

  • Click Summary Variables from the navigation bar.
  • Click New.
  • In the Variable Name field, enter Sum of Hardware (Tata Cars)
  • For the Aggregate Function field, choose Sum.
  • For the Aggregate Field field, choose Quantity.
  • For the Target Object field, choose Product Option
  • For the Filter Field field, choose Product Code.
  • For the Operator field, choose equals.
  • In the Filter Value field, enter WARRANTY
  • Click Save

Step 3: Create a Validation Product Rule

  • Click Product Rules from the Navigation bar.
  • Click New.
  • In the Product Rule Name field, enter Warranty Sum should be Equal to Sum of Hardware Product.
  • For the Type field, choose Validation
  • The Scope field remains as Quote, since you need the rule to run on the quote in general, not within a specific bundle.
  • For the Evaluation Event field, choose Save.
  • Check Active.
  • For the Conditions Met field, choose All.
  • In the Message field, “Please Check !! Sum of Warranty should be Equal to Sum of Hardware Product.”
  • Click Save.

Step 4: Create an Error Condition to Leverage a Summary Variable

  • In the Error Conditions related list, click New.
  • Index:10.
  • In the Tested Variable field, search for and select Sum of Warranty (Tata Cars).
  • For the Type field, choose Validation
  • For the Operator field, choose less than.
  • For the Filter Type field, choose Variable.
  • In the Filter Variable field, enter Sum of Hardware(Tata Cars).
  • Click Save.

Step 5: Create an Error Condition to Leverage a Summary Variable

  • In the Error Conditions related list, click New.
  • Index:20.
  • In the Tested Variable field, search for and select Sum of Warranty (Tata Cars).
  • For the Type field, choose Validation
  • For the Operator field, choose Greater than.
  • For the Filter Type field, choose Variable.
  • In the Filter Variable field, enter Sum of Hardware(Tata Cars).
  • Click Save.

Step 6: Save configuration rule by making it Active as per picture

Final Step Testing :Test the Validation Rule

  • Click Accounts in the Navigation bar.
  • Click The Name of Account.
  • Click The Name of Account.
  • Click the Related tab.
  • From the Quotes related list, click Q-XXXX.
  • Click Edit Lines.
  • Click Add Products.(Warranty, Tata Cars, Keys, Toolkit)
  • Update the quantity of the Warranty.
  • Click Save.

If Sum of all Hardware Products is not equal to Sum of Warranty Products then this validation rule will fire and then it does allow to save this quote.

Filter condition

Step 3: put the price action in related list of price rule

Note -: Rule should be Activated.

Share the Post: