Salesforce CPQ – Product Rules vs. Option Constraints, by Krishna Katve

Understand Advantages of these Important Salesforce CPQ Tools. Guest post by Sr. Salesforce Developer Krishna Katve.


Related References:


Background

When configuring products in Salesforce CPQ, there are often multiple ways to accomplish similar ends. One such area of optionality is found when considering Product Rules vs. Option Constraints. We will take a look at when to use each, and what to consider when comparing these techniques.


Usage Basics

When to Use Product Rules

Hiding and Showing Product Options, based on other product selections, is a technique frequently used to narrow down configuration options. This approach is especially useful on larger configurations displayed across Categories(Tabs), where each Category may otherwise require extensive scrolling is all options are shown. Defaulting Product Options to hidden, and then conditionally showing when pre-requisite conditions are met, is an effective way to reduce the visual space taken on each tab, and thus to reduce scrolling.

When to Use Option Constraints

If you have fewer options and you can fit all Product Options on the Category/Tab without a lot of scrolling, then it may be better to go with Option Constraints. These cannot hide Product Options completely, but can enable/disable Product Options using other selections. Enabling a Product Option based on multiple other Product Options (complex combinations) is also possible using Option Constraint Groups. For overall user experience, Option Constraints can be better as they enable/disable Options immediately without a spinner/delay as would be experienced with Product Rules. We will take a look at a couple of examples of this approach below.


Option Constraint – Dependency Example

Dependency Option Constraints help to enable/disable a Product Option (Constrained Option) depending on the selection of another Product Option (Constraining Option).

Example of Configuration Using Dependency Option Constraint

  • Let us look at a complex rule for a Dell Laptop Bundle – we will achieve this using Option Constraints. Following are the Features and Product Options in the bundle:
ModelOperating SystemGraphicsMemory
Dell InspironWindowsUltra HD8 GB
Dell XPSLinuxHD16 GB

Requirement :

  • 16 GB Memory should be only available if one of following is selected
  • Windows OS and Ultra HD
  • Linux

Solution:

  • We can achieve this using 3 Option Constraints – for the administrator this is a straightforward setup, and will offer a superior user experience as well. This is because we don’t have to write complex Product Rules which will take time to calculate and load.
Constrained OptionConstraining OptionTypeOption Constraint Group
16 GBWindowsDependencyWINDOWS_16GB_MEMORY
16 GBUltra HDDependencyWINDOWS_16GB_MEMORY
16 GBLinux  Dependency LINUX_16GB_MEMORY

Notes:

  • For ‘Windows + Ultra HD’ combination, we have multiple Constraining Options targeting the same Product Option. This technique requires the use of Option Constraint Groups – here given as ‘WINDOWS_16GB_MEMORY’.
  • For ‘Linux’ only requirement, Option Constraint Groups are not needed as there is only one Product Option controlling the other. Here we use a standard Option Constraint with no Option Constraint Group.
  • Note that Product Feature minimum and maximum values can often achieve some of this constraining logic, so don’t over-engineer things if you don’t have to. For example, if we want to only allow 1 out of a group of Product Options to be selected, we can easily put them in the same Feature, and put a Max selection value of 1. This will not give us an immediate visual queue aside from some text, but will block over-selection on Save.

Option Constraint – Exclusion Example

As shown previously, Dependency Option Constraints allow us to only allow a certain Product Option if another (or multiple) Product Option has been selected. Exclusion Option Constraints behave in the opposite way, where if one Product Option is selected we want another to be un-selectable.

Example of Configuration Using Exclusion Option Constraint

  • Let’s add one more feature to the laptop bundle we configured earlier – Warranty options. Here we have 3 potential selections:
Warranty Options
24/7 Access to Specialists
Repairs using New parts
Repairs using Refurbished parts

Requirement:

  • Only one of the “Repairs using New parts” or “Repairs using Refurbished parts” can be selected, but 24/7 Access to Specialists is a standalone option.

Solution:

  • One Option Constraint. It does not matter which field, Constrained Option or Constraining Option, you use for this particular setup. If one is selected, then the other cannot be.
Constrained OptionConstraining OptionTypeOption Constraint Group
Repairs using New partsRepairs using Refurbished partsExclusion 

Before you Use Product Rules, Consider These Points

  • Consider Exclusion Option Constraints or Feature min/max fields over validation Product Rules – for example, when you need to show an error message when two Product Options are selected, and the user should only select one.
  • Always try to meet the business requirement using Option Constraints first. If you are unable to achieve the desired result, then consider Product Rules.
  • Additional note on the ‘On Load’ event of Product Rules. In many cases we may want to show or hide Product Options using an attribute from the Quote (which users don’t change during configuration). There is an intermittent limitation currently where ‘On Load’ Product Rule using quote fields in Lookup Queries does not work consistently, but it did work on some of my configurators. If ‘On Load’ does not work, go with ‘Edit’/’Always’ as appropriate. Unfortunately this is burdensome as CPQ will execute this rule every time rules run – even when not really needed.
  • If you keep using this approach of Option Constraints over Product Rules wherever possible, this will make your configurator as light and fast as possible. For a comparison, please see below some clips of the difference in approach and performance.
  • Product Rules
Product Rule Example
  • Option Constraints
Option Constraint Example

Wrapping Up

Thanks to Krishna for contributing, and let him know if you have any questions about this content!

Leave a Reply

Your email address will not be published. Required fields are marked *