Author: Rishabh Dubey
Both Alert and Validation Product Rules are used to keep the integrity of the quote data. Where Alert Product Rules are used to display a friendly reminder to the end users that users can skip and save the quote and the Validation Rule provides an error message that users can not skip until they make necessary changes to the quote data.
Requirement 1: If a quote is getting created for a trial opportunity, the total amount on the quote should be less than 1000 USD. We want a friendly reminder to the sales rep regarding the same. However, users can ignore this message and create a quote with an amount greater than 1000 USD.
Solution:
Step 1: Click on the Product Rule Tab and then click on New.
Step 2: Fill in all the required fields.
Product Rule Name: Trial Opportunity: Alert Rule
Type: Alert
Scope: Quote
Evaluation Event: Save
Evaluation Order: This will determine the order of evaluation of this rule (Choose Accordingly).
Active: True
Conditions Met: All
Advance Conditions: Null
Message: This Quote is for Trial Opportunity. Please Make sure the total amount does not exceed 100 USD.

Step 3: Go to the related list of the Product Rule and click new on the error condition and fill in all required fields.
Tested Object: Quote
Tested Field: Opportunitytype__C (values with fields API names can be added from the object manager).
Operator: Equal
Filter Type: Value
Filter Value: Trial

Step 4: To test this create a quote and add products with a value greater than 1000 USD and Click save.

This alert message will be populated. However, you can click on continue and save the quote ignoring the error message.
Requirement 2: For the Product “I Phone Combo” which has 4 product options, 2 iPhones with Product family mobile and 2 Airpods with product family Earbuds.
We want the quantities of Airpods to not be greater than the Number of iPhones.
Solution:
Step 1: Click on the Product Rule Tab and then click on New.
Step 2: Fill in all the required fields.
Product Rule Name: I Phone Combo Bundle
Type: Validation
Scope: Product
Evaluation Event: Save
Evaluation Order: This will determine the order of evaluation of this rule (Choose Accordingly).
Active: True
Conditions Met: All
Advance Conditions: Null
Message: Earbuds Quantities can not be greater than Mobile phone quantities.

Step 3: Before creating error conditions, we need to create two summary variables that will give us the count of iPhones and Earbuds.
- Go to the summary variable tab and click on new.
- Fill in all the required fields.
Variable Name: Earbuds Quantity
Target Object: Product Option
Aggregate Function: Sum
Aggregate Field: SBQQ__Quantity__c
Filter Field: Product Family
Operator: equals
Filter Value: Earbuds

- Perform the same steps for mobile quantity.
Variable Name: Mobile Quantity
Target Object: Product Option
Aggregate Function: Sum
Aggregate Field: SBQQ__Quantity__c
Filter Field: Product Family
Operator: equals
Filter Value: Mobile

Step 4: Go to the related list of the Product Rule and click new on the error condition and fill in all required fields.
Tested variable: Earbuds Quantity
Operator: Greater than
Filter type: Variable
Filter Variable: Mobile Quantity

Step 5: Go to the related list of the Product Rule and click on the configuration rule and fill in all required fields.
Active: True
Product: iPhone Combo
Product: iPhone Combo bundle

Step 6: To test the same add an iPhone bundle to a quote and add earbuds quantity greater than Mobile phone quantities.

Users will not be able to save the quote until they make the earbuds quantity equal to or lower than the Mobile quantity.