Create Twin Fields on the Quote Line
Make a Home for Attribute Data
As we discussed in an earlier step, the Product Configuration page is not a record, and attributes are not fields. Attributes are manifestations of fields. So if the sales rep chooses 40mm for the Smartwatch size, where does that data get saved to when the rep clicks Save?
As it stands, there is no place for the Size attribute data to get saved to. But there is a simple solution to this. You must create a field on the Quote Line object to act as a receiving container for the attribute data. For example, let’s create a field on the Quote Line object named Size, and make it a picklist. Then give it the same picklist values as the field you originally made on the Product Option object.
Now you’re probably wondering: How does the data get from the attribute in Product Configuration into the field on the quote line? The answer: CPQ takes care of that for you automatically, as long as the API names and data types of the two fields match exactly. We call these two fields twin fields since they should be identical to each other.
Let’s create the six necessary twin fields on the Quote Line object. You start by navigating to the Object Manager.
- If you’re not still on the setup page, click and click Setup. The Setup page opens in a new tab.
- Click Object Manager.
- Click Quote Line.
- Click Fields & Relationships.
- Click New.
- Click Picklist.
- Click Next.
- For Field Label, enter
Size
. - Click the radio button to Enter values, then enter each of these values on a separate line:
40mm
44mm
- Click Next.
- Click Next to keep field-level security as is.
- Click Save & New.
Now to create the Accent twin field. - Click Picklist.
- Click Next.
- For Field Label, enter
Accent
. - Click the radio button to Enter values, then enter each of these values on a separate line:
Light Gray
Dark Gray
Gold
- Click Next.
- Click Next to keep field-level security as is.
- Click Save & New.
And now the Engraving twin field. - Click Text.
- Click Next.
- For Field Label, enter
Engraving
. - For Length, enter
100
. - Click Next.
- Click Next to keep field-level security as is.
- Click Save & New.
Good, now a twin field for Outlet Standard. - Click Picklist.
- Click Next.
- For Field Label, enter
Outlet Standard
. - For Values, choose Outlet Standard.
- Click Next.
- Click Next to keep field-level security as is.
- Click Save & New.
Almost there, now for the Material twin field. - Click Picklist.
- Click Next.
- For Field Label, enter
Material
. - Click the radio button to Enter values, then enter each of these values on a separate line:
Silicone
Canvas
Stainless Steel
Leather
- Click Next.
- Click Next to keep field-level security as is.
- Click Save & New.
And finally, create the twin field for Color. - Click Picklist.
- Click Next.
- For Field Label, enter
Color
. - Click the radio button to Enter values, then enter each of these values on a separate line:
Light Gray
Dark Gray
Gold
Black
White
Brown
Red
Blue
Green
Purple
Pink
Yellow
- Click Next.
- Click Next to keep field-level security as is.
- Click Save.
Close the Setup tab to get back to the Salesforce CPQ tab.
Now when you save the Smartwatch configuration, all of your attribute values are saved too.
Technically, the values for configuration attributes are saved onto the quote line record of the lead product, and values for global attributes are saved onto the quote line records of their respective products. Here’s an example of what an export of our quote line data would look like.
Quote Line Record | Size__c | Accent__c | Engraving__c | Outlet_Standard__c | Material__c | Color__c |
---|---|---|---|---|---|---|
QL-00001 SMARTWATCH |
44mm | Dark Gray | Philip Cleverham | Type A (North America) | ||
QL-00002 SMARTWATCHBAND |
Light Gray | Silicone | Purple | |||
QL-00003 SMARTWATCHBAND |
Dark Gray | Leather | Black | |||
QL-00004 ACTOUSBADAPTER |
||||||
QL-00005 USBCMAGWATCHCHARGER |
||||||
QL-00006 USBCWIRELESSCHARGINGPAD |
Notice that the Size data isn’t stored in either of the watch band quote lines. That’s a problem because watch bands come in two sizes. The Order Fulfillment team needs to know that information so it delivers the correctly sized spare watch band. In the same way, the Outlet Standard data isn’t attached to the ACTOUSBADAPTER quote line, which will also present a problem for Order Fulfillment.
Fixing this missing data is easy. You just need to tell CPQ to save attribute values to option quote lines. You do this by setting Apply to Product Options to true, found on the configuration attribute record.
- From the navigation bar, click Products.
- Click Smartwatch.
- Click the Related tab.
- From the Configuration Attributes related list, click Size.
- Click Edit.
- Check Apply to Product Options.
- Click Save.
Now every quote line record that’s part of the bundle contains the 44mm value in the Size field. Now do the same for Outlet Standard. - Click Smartwatch in the Product field.
- Click the Related tab.
- From the Configuration Attributes related list, click Outlet Standard.
- Click Edit.
- Check Apply to Product Options.
- Click Save.
The value for Outlet Standard is now included in the ACTOUSBADAPTER quote line (along with all other quote lines in the bundle).
Well done setting up your twin fields on the quote line, and setting your configuration attributes to apply their values to the quote lines of bundled options. In the next and final step, you make sure the configuration data flows to the Order Products too.