Skip to main content

Control Options with Selection Rules

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe how product rules can affect options in a configurable bundle.
  • Create a selection-type product rule.
  • Create product action records to affect options.
  • Clone a product rule and alter it for a new purpose.

The Helping Hand of Selection Rules

So far we’ve spent a lot of time talking about product rules that prevent sales reps from making mistakes by alerting them of potential problems. But what if there was a kind of rule that took action to automatically make necessary changes to a configuration to avoid issues in the first place? Well that’s exactly what selection-type product rules aim to do.

For simplicity, we just call them selection rules from this point forward. There are a number of ways selection rules take action to affect how bundles are configured.

Action

Result

Add

Checks an option

Remove

Unchecks an option

Disable

Makes an option’s checkbox grayed out and uncheckable

Enable

Makes an option’s checkbox normal and checkable

Disable & Remove

Unchecks an option, and makes the option’s checkbox grayed out and uncheckable

Enable & Add

Makes an option’s checkbox normal and checkable, and checks it

Hide

Completely removes an option from the page layout

Show

Brings a hidden option back into the page layout

Hide & Remove

Completely removes an option from the page layout and unchecks it

Show & Add

Brings a hidden option back into the page layout, and checks it

With the right combination of actions, a single product rule can quickly get a sales rep to a properly configured bundle, or at least give them a head start down the right path.

Create Two Opposing Selection Rules

Selection rules have a lot of similarities to the rules you’ve created so far, except this time you won’t set up a message to pop up when there’s an issue. Instead, you create an action for CPQ to take.

Let’s look at a scenario that benefits from selection rules. Imagine that you have a bundle for a home automation kit that includes things like smart light bulbs, outlets, and power strips.

Product Configuration page of the Home Automation Hub bundle

At the bottom of the page there is an option for electrical installation, which is highly recommended if an outlet is selected. But it should never be selected if outlets are not part of the bundle. To meet these business requirements, you have to make a number of things, including:

  • A summary variable to see how many outlets are selected
  • A rule that disables and removes electrical installation if zero outlets are selected
  • A rule that enables and adds electrical installation if an outlet is selected

To get started, you create the summary variable.

  1. From the navigation bar, click Summary Variables.
  2. Click New.
  3. For Variable Name, enter Outlet Sum.
  4. For Target Object, choose Product Option.
  5. For Aggregate Function, choose Sum.
  6. For Filter Field, choose Product Code.
  7. For Operator, choose ends with.
  8. For Filter Value, enter OUTLET.
  9. Click Save.

Good, you now have a summary variable that can be used in both rules, isn’t that helpful? Now let’s create the first rule, which is meant to disable the Electrical Installation option. You start by creating the Product Rule record.

  1. From the navigation bar, click Product Rules.
  2. Click New.
  3. For Product Rule Name, enter Disable and remove electrical installation.
  4. For Type, choose Selection.
  5. For Scope, choose Product.
  6. For Evaluation Event, choose Always.
    You’re choosing Always because you want the rule to run at two times: when the configuration page first loads, and whenever an edit occurs. Note, selection rules for bundles don’t run on Save, so that isn’t part of the Always choice.
  7. Check Active.
  8. For Conditions Met, choose All.
  9. Click Save.

OK, now you create the error condition. You want the rule to fire when our summary variable is zero, meaning no outlets are selected.

  1. In the Error Conditions related list, click New.
  2. For Tested Variable, look up and choose Outlet Sum.
  3. For Filter Operator, choose equals.
  4. For Filter Type, choose Value.
  5. For Filter Value, enter 0.
  6. Click Save.

Now that you’re becoming a pro at making error conditions, it’s time for something new. Let’s create the action record, which is where you put instructions for what CPQ should do when the rule fires.

  1. In the Actions related list, click New.
  2. For Type, choose Disable & Remove.
    This is a combo action that makes the option uncheckable and removes the check if it’s there.
  3. For Product, look up and choose Electrical Installation.
    For this example you’re acting on just one product, so you use the lookup field. In the next unit you investigate how to act on multiple products.
  4. Click Save.

That’s it, your action is done. The final step is to make this product rule apply to the Home Automation Hub bundle.

  1. In the Configuration Rules related list, click New.
  2. Check Active.
  3. For Product, look up and choose Home Automation Hub.
  4. Click Save.

Excellent, your first selection rule is done. But wait, you need to make another. As it stands, even if you were to configure the bundle to include a smart outlet, the Electrical Installation option would remain disabled. That’s because selection rules only do what they’re told, and they don’t undo what they’ve done once they stop running. So you need a rule to enable electrical installation if outlets are selected.

You can make another rule from scratch, but let’s save some time and clone our first rule, then make a few tweaks to reverse its behavior.

Product Rule record with Clone with Related highlighted

  1. Click Clone with Related.
    At this point the rule isn’t cloned. You’re given a chance to preview what CPQ will create if you do clone the rule. You can expand each section using the arrows to the right.
    Product Rule Preview page with expanded sections
  2. Click Clone.
    Now to make some tweaks.
  3. Click Edit.
  4. For Product Rule Name, replace with Enable and add electrical installation.
  5. For Evaluation Event, choose Edit.
    If you left this as Always, then the installation would be selected upon saving the bundle even if it's not wanted.
  6. Click Save.
  7. In the Error Conditions related list, click Edit from the dropdown menu of the condition record.
  8. For Operator, choose greater than.
    This makes the rule fire if any outlets are selected.
  9. Click Save.
    Finally, let’s tell CPQ to enable the option and check it, since we strongly recommend adding electrical installation.
  10. In the Actions related list, click Edit from the dropdown menu of the action record.
  11. For Type, choose Enable & Add.
  12. Click Save.

The “clone and reverse” method is done, so our rules are ready. There’s one last thing to do to make sure your rules run when you want them to. Remember, rules shouldn’t evaluate on every little change to a bundle, that would be taxing to both the system and the sales rep’s patience. You need to make sure CPQ evaluates your rules the moment a sales rep makes an edit to the Smart Outlet options. You do that by setting Apply Immediately to true for all three options.

  1. From the navigation bar, click Products, then choose the All Products list view.
  2. Click Home Automation Hub.
  3. Click the Related tab.
  4. In the Options related list, click View All.
  5. Click Edit from the dropdown menu of the Smart US Power Outlet option.
  6. Check Apply Immediately.
  7. Click Save.
  8. Repeat steps 5 to 7 for the Smart UK Power Outlet and Smart EU Power Outlet options.

You’ve invested a lot of effort into these rules, so let’s make sure they work as expected.

  1. From the navigation bar, click Quotes, then choose the All list view.
  2. Click Q-00041.
  3. Click Edit Lines.
  4. Click Add Products.
  5. Check Home Automation Hub.
  6. Click Select.
    Immediately you should see that the Electrical Installation option can’t be checked. Great, now let’s see if you can get it enabled.
  7. Check Smart US Power Outlet.
    The screen dims for a second, which indicates that your rules are running. Soon you should see that the Electrical Installation option is checked and the box is no longer gray. Sales reps can uncheck installation if they want to, but now it’s less likely that they forget to offer the service.
  8. Uncheck Smart US Power Outlet.
    The Electrical Installation option should go back to gray and unchecked.

Well done! Before you celebrate, there are a few important considerations when using selection rules to add products. First, sales reps may not always realize when options are automatically added. Second, if a sales rep unchecks electrical installation, then does something unrelated that causes rules to run again, the option gets checked again (because the rule ran again). In both instances, sales reps can accidentally sell something they didn’t intend to. For that reason it’s a good idea to train users in what to expect when configuring bundles that use selection rules.

Resources

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback