Product Validation Rules

by KSmith on ‎12-17-2015 10:24 PM - edited on ‎11-04-2016 10:25 AM by Community Manager

Product Rules can be setup as Validation Rules to ensure the validity of product combinations on a quote as well as values entered on specific quote lines or within configuration attributes.  Product Validation Rules utilize Product Rules and Error Conditions to display an error message at the top of the Quote Line Editor page or the Configure Product page when the condition(s) are met. 

 

ADMINISTRATION

  1. Navigate to Product Rules.
  2. Set the Type field to Validation, then enter values for the remaining fields as needed. Click Save when finished.Product Rule Detail.png
  3. Fields Description
    Product Rule Name Name of Product Validation Rule.  It is best to enter a meaningful name here to make it easier to distinguish between other Product rules you may have.
    Conditions Met

    Choose how to apply the Error Conditions:

    • All: All conditions must evaluate to "True" for the rule to fire. 
    • Any: Only one condition must evaluate to "True" for the rule to fire. 
    • Custom: Use with Advanced Conditions field to determine how conditions are evaluated.  For example, this enables a rule with 3 conditions to be handled in the following fashion: 1 AND (2 OR 3).  
    Scope

    Choose where the rule will be applied:

    • Product: Rule will be used within a product bundle. 
    • Quote: Rule will fire in the Quote Line Editor.
    Evaluation Event Choose an Evaluation Event:
    1. Load: The rule will be evaluated when the configuration page loads.
    2. Edit: The rule will be evaluated when a user selects or deselects an option on the configuration page. This event provides real-time processing if the selected or deselected option, or configuration attribute, is flagged as 'Apply Immediately'.
    3. Save: The rule will be evaluated when the user clicks Save on the configuration page.
    4. Always: The rule is evaluated on page load, after changes are made, and upon save. Use this option when creating Real-Time Product Rules.
    Type Choose Validation 
    Active Indicates whether this rule is active or inactive. Select the checkbox to ensure this rule is active before you begin testing.
    Message All Validation Rules require an Error Message.  This is the message that will display to the user to inform them what is incorrect about the current configuration.
    Evaluation Order This field is used to determine the order in which the product rules fire.
    Advanced Conditon

    Used to apply logic to the created conditions.

  4. Enter your Error Conditions, then click Save:
    Field
    Description
    Rule Name of the product rule related to the error condition.  This is a lookup field and is pre-populated to the current rule by default. 
    Index Assign a unique number to this condition to reference it in the Price Rule's Advanced Condition.
    Tested Object If you are evaluating a field on an object, select that object here.  You can choose from Quote, Quote Line, Product Option, Configuration Attribute, or Upgraded Asset. 
    Tested Field Select the field being evaluated if applicable.  This is a dependent picklist and will be populated with available fields related to the Tested object. 
    Tested Variable If evaluating a summary variable and not a field, enter or lookup the summary variable in this field.
    Operator Choose operator for condition.
    Filter Type

    Choose:

    • Value: to evaluate against a specified value. 
    • Variable: to evaluate against a Summary Variable. 
    Filter Value Enter value you are comparing against.
    Filter Variable Enter or lookup to the summary variable you are comparing against.

     

  5. Below is a sample Error Condition for a Validation Rule. This condition reads as "If 'Count Maintenance' is less than 1, evaluate to 'True.'"Error Condition Edit.png

     

CREATING A RULE WITH ADVANCED CONDITIONS

As of Winter '16, SteelBrick allows admins to use logical ANDs and ORs to build product configuration rules, which provides more control over which conditions apply to the rule.  For example, this enables a rule with 3 conditions to be handled in the following fashion: 1 AND (2 OR 3). 

Setup: 

  1. For Upgrades: Make sure you add "Custom" as a picklist value for the Conditions Met field.  You will also need to add the "Advanced Condition" field to the Product Rule page layout. 
  2. Select All from the Conditions Met dropdown menu. You will later be required to change the Conditions Met to Custom, but in order to avoid receiving an error message during setup, the Conditions Met should remain as All until the setup process is complete.
  3. Click Save.
  4. Add your Error Conditions.
  5. Change the Conditions Met dropdown selection to Custom.
  6. Enter your Advanced Condition using the Index on the error condition as your reference when creating a particular Advanced Condition formula.advanced cond.png

 

 

USE CASES

Example 1 - Validate the correct value is entered in a configuration attribute.

While numbers sometimes need to be entered in a configuration attribute, the attribute does not contain a min or max field to restrict the numbers entered. For example: A Configuration Attribute targeted a number field, and the value entered needed to be between 5 and 10.

 

Product Rule Name Configuration Attribute Value Validation
Type Validation
Condition Met All
Scope Product
Error Message "Configuration Attribute Value must be between 5 and 10.".
Error Condition

Tested Object: Configuration Attribute

Operator: greater or equals

Filter Type: Value

Filter Variable: 5

Error Condition

Tested Object: Configuration Attribute

Operator: Less or equals

Filter Type: Value

Filter Variable: 10

 

Example 2 - Product Validation Rule that evaluates within the Quote Line Editor

Your business sells licenses and training seats to a user. Each license also requires a training seat. You can create separate Summary Variables that count the total number of licenses and training seats, then use a Product Validation Rule to determine if they are equal on the quote.

 

Product Rule Name License is equal to Training
Type Validation
Condition Met All
Scope Quote
Error Message "The number of Training Seats must equal the number the User Licenses.  Please review."
Error Condition

Tested Variable: Training Seats Count

Operator: equals

Filter Type: Variable

Filter Variable: User Licenses Count

 

Example 3 - Quote Product Rule

Your business sells a variety of hardware and maintenance items. If you sell hardware such as servers, which require maintenance and support, you can create separate Summary Variables - one that counts the total number of services and one that counts the total number of maintenance items. These variables will use a Product Rule to determine if the number of services and maintenance items are equal on the quote.

 

Summary Variable

Field Value (Servers) Value (Maintenance)
Variable Name Total Number of Servers Total Number of Maint.
Aggregate Function Sum Sum
Target Object Quote Line Quote Line
Aggregate Field Quantity Quantity
Filter Information Product Family = "Servers"

Product Family = "Maintenance"

 

Finally, create a Product Rule record that compares these two Summary Variables and displays an error when they are not equal. In this scenario, the Product Rule would contain a single error condition like this: 

 

Product Rule

Product Rule Name Server must equal maintenance
Type Validation
Condition Met All
Error Message "Your total number of servers must meet maintenance items. To continue, please change these quantities".
Error Condition

Tested Variable: Total Number of Servers

Operator: not equals

Filter Type: Variable

Filter Variable: Total Number of Maint.

 

Example 4 - Validation Rules Testing of Quote Line Group fields

As of Salesforce CPQ Winter 17, users may select Quote Line Group as the Error Condition's Tested Object. Users can then test against Quote Line Group field values within the Quote Line Editor.

 

For example, a computer design business provides three different desktop build packages, represented on the Quote by three Quote Line Groups: Red, Green and Blue. These package colors are controlled by a custom Color field added to the Quote Line Group object. If the business has temporarily suspended the sale of Red packages, an admin can create a Validation Rule that prevents sales reps from creating a Red package in the Quote Line Editor. nored.png

 

This Validation Rule should be created as follows:

Field / Related List Values
Product Rule Name No Red Groups
Type Validation
Condition Met  All
Scope  Quote
Evaluation Event Always
Message No, cannot have Red Groups!
Error Condition 

Tested Object: Quote Line Group

Tested Field: SBQQ__Color__c

Operator: Equals

Filter Type: Value

Filter Value: Red

 

NESTED BUNDLE VALIDATION RULES

As of SteelBrick CPQ Spring '16, Validation Rules can be applied to Nested Bundles within a Parent Bundle. Review Validation Rules in Nested Bundles for a comprehensive walkthrough.

 

Comments
by mattynutt
on ‎01-28-2016 10:28 AM

Can you use comma separated values in error conditions?  specifically in the filter value field?

by stephennanos
on ‎02-20-2017 08:53 AM

@mattynutt, you may have figured this out as this is old, but for others, yes you can use comma separated values in the error conditions for the filter value field. Makes things much easier!