Limit Color Choices Based on Material
Use Core Salesforce Functionality
AW Computing is very happy that its sales reps can choose various materials and colors for the smartwatch band. However, the company only offers stainless steel in light gray, dark gray, and gold. And they only offer leather in black, white, and brown. You must prevent sales reps from choosing combinations that AW Computing doesn’t offer.
One way to limit the choices in a picklist field is to create a dependency between it and another field. This is a core Salesforce admin task that you can apply to CPQ. Let’s create a dependency between the Material and Color fields. You start by navigating to the Object Manager.
- Click and click Setup. The Setup page opens in a new tab.
- Click Object Manager.
- Click Product Option.
- Click Fields & Relationships.
- Click Color.
- For Controlling Field, click New.
- For Controlling Field, choose Material.
- For Dependent Field, choose Color.
The values of Color will depend on the choice of Material.
- Click Continue.
- In the Silicone column, double-click all colors except Gold.
- In the Canvas column, double-click all colors except Gold.
- In the Stainless Steel column, double-click Light Gray, Dark Gray, and Gold.
- In the Leather column, double-click Black, White, and Brown.
Great, your field dependencies should like this.
- Click Save.
Close the Setup tab to get back to the Salesforce CPQ tab.
Now when you configure the Smartwatch bundle, you’ll find that the choices for color surface based on the material that's selected. Now sales reps at AW Computing won’t promise anything they can’t deliver.
Bear in mind that since you made Color__c a dependent field, any configuration attribute based upon it is subject to the exclusions you defined in the dependency. For example, imagine you had a Smartphone Case product that also needed a Color attribute. If you create the new attribute based on Color__c, it will still be dependent on Material__c. So if you don’t create an attribute for Material, then the Color attribute will show no values. That’s just the way dependent fields work.
In the future you might need to create a Color attribute for a different option, such as a Smartphone Case. But what if the values shouldn’t be limited by the dependency you just created? In that scenario, you would just create a second color field (Color2__c) on the Product Option object, free of any dependencies. Then use that field for the new Color attribute.
Finally, dependencies only work when the two fields are on the same level. In other words, a configuration attribute set up as the controlling field cannot control a global attribute attached to a product option. In the same way, the Material of the first watch band only controls the Color of the first watch band, not the Color of the second watch band.
At this point, sales reps can gather information to properly configure a watch. In the next step, you make sure the information is saved to the quote line records.