Rearrange the Line Item Table
Learning Objectives
After completing this unit, you’ll be able to:
- Separate quote lines into two or more line item tables.
- Create subgroups within line item tables that include subtotals.
- Determine which totals and subtotals appear under line item tables.
- Show or hide quote lines in the line item table based on various criteria.
Gotta Keep ’Em Separated
When you preview your proposal with Q-00053, you find that all of the line items are placed into a single table, which is usually just fine. But some businesses prefer to split quote lines into separate tables to make the quote easier to parse, and to show subtotals of related products. With Salesforce CPQ, you can group line items by just about any criteria you can imagine.
In order to group line items, you just need to tell CPQ which quote line text field to group by. Then, it makes a group for every unique value it finds. Let’s see how this works by making a text formula field that separates subscription products from non-subscription products. You start by navigating to Setup.
- Click and click Setup. The Setup page opens in a new tab.
- Click Object Manager.
- Click Quote Line.
- Click Fields & Relationships.
- Click New.
- Choose Formula.
- Click Next.
- For Field Label, enter
Purchase Type
.
In real life the name of the field doesn’t matter, just remember it for later. - Choose Text.
- Click Next.
- For Formula, enter
IF(ISPICKVAL(SBQQ__SubscriptionPricing__c, ""),"One-time Purchases","Subscriptions")
.
This formula checks if the Subscription Pricing field is blank, meaning the product must be a one-time purchase. Otherwise it’s a subscription. - Click Next.
- Click Next to keep field level security as is.
- Click Save.
Before you can tell CPQ to use the Purchase Type field in your quote template, you have to add the API name of the field to the Group Field picklist.
- Click Object Manager.
- Click Quote Template.
- Click Fields & Relationships.
- Click Group Field.
- In the Values section, click New.
- Enter
Purchase_Type__c
.
This is the API name of the Purchase Type formula field. - Click Save.
You can close the Setup tab, you’re ready to update your quote template and give it a little style at the same time.
- In the navigation bar, click Quote Templates.
- Click AW Proposal.
- Click Edit.
- For Group Shading Color, enter
F5F5F5
. - For Group Font Size, enter
12
. - For Group Field, choose Purchase_Type__c.
- Click Save.
Great, now CPQ knows to use the custom field to distinguish one quote line from another. If you preview the proposal with Q-00053, you get tables that look like this.
Grouping line items with the Group Field is pretty neat, but there are a few caveats to be aware of.
- Bundled products can be separated into different groups.
- If your sales reps use Quote Line Groups in the Quote Line Editor, CPQ always uses their grouping regardless of what the Group Field is set to.
- There’s a Group Field on the template section record that takes precedence over the quote template version.
Groups Within Groups
If you like grouping line items, you’re going to love subgrouping. It adds an extra layer of grouping based on another quote-line field. Subgrouping takes two steps to set up. The first is to identify the field to subgroup by. Let’s choose Product Family.
- While on the AW Proposal quote template record, click Edit.
- For Sub Group Field, choose Product Family.
This is an out-of-the-box value that uses the product family that originates from the product record. - Click Save.
Good, you’re halfway there. The second step is to tell CPQ to sum the values of at least one line column. The Customer Price column is perfect for that.
- Click the Related tab.
- In the Line Columns related list, click View All.
- For the CUSTOMER TOTAL record, click Edit from the menu.
- For Summary Level, choose Sub Group.
This shows a subtotal row only for each sub group. If you choose All for Summary Level, an extra row is added to the bottom for the whole group, which you don’t need since each group already shows a subtotal. - For Summary Function, choose SUM.
- Click Save.
Let’s also sum the Partner Price column. - For the PARTNER PRICE record, click Edit from the menu.
- For Summary Level, choose Sub Group.
- For Summary Function, choose SUM.
- Click Save.
Without doing anything more, sums for Customer Total and Partner Price will appear in summary rows. But to make it more clear what the values mean, let’s add labels into the PRODUCT column. - For the PRODUCT line column record, click Edit from the menu.
- For Summary Level, choose Sub Group.
- For Sub Group Summary Label, enter
{0} Subtotal
.
The {0} is a placeholder that is replaced with whatever product family the line item belongs to. For example, “Hardware.” - Click Save.
Now when you preview Q-00053 you find new rows separating line items within a group, each with labels and a product family total.
By the way, if you’re doing the math you may notice that the subtotals amount to more than the total at the bottom of the table. That’s because the 10” Tablet is an Optional item, which doesn’t contribute to totals at the bottom of the table. Later you learn how to hide Optional items.
Total Control of Totals
By default, the tables in your proposal have a total displaying in the lower right. There are a number of ways to change what appears under the table, and after all tables. Here are the fields that can affect totals, where to find them, and what they do.
Field Name (Location) |
Affect on Totals |
---|---|
Print Quote Totals |
When checked and lines are grouped, displays overall quote totals after group tables. [1] |
Subtotal Field |
Adds your choice of either List, Regular, Customer, or Net Price subtotals [2][3]. |
Show Customer Discount & |
When checked, adds the value of the selected Customer Discount Field [4][5]. If that field is blank, List minus Customer amount is displayed. When using a custom field be sure it exists at both the quote and quote line level, otherwise one of the customer discount totals will not appear. |
Show Partner Discount |
When checked, adds the calculated amount of Partner Discount [6][7]. |
Total Field |
Displays your choice of either List, Customer, or Net Price subtotals [8][9]. Displays List Price if blank. |
Hide Group Subtotals |
When checked and lines are ungrouped, hides subtotal [2]. When checked and lines are grouped, hides subtotal [2] and total [8]. |
Hide Totals |
When checked and lines are ungrouped, hides total [8]. |
Summary Display |
“Always” will show subtotal [2] and total [8] regardless of Hide Group Subtotals or Hide Totals values, but doesn’t force display of discounts [4][6]. “Never” will remove all subtotals [2][4][6][8] from tables regardless of other field values. |
Hide Line Items Using Basic Controls
Although we love all quote lines equally, some are just not as important as others. Often, businesses want to hide certain lines to keep the focus on others. There are a few fields that quickly determine if a quote line is included in the proposal.
Field Name (Location) |
Affect on Line Visibility |
---|---|
Hide Component Products |
When checked, removes any product that’s an option for a bundle. By default they are shown. |
Show Bundled Products |
When checked, options that are marked as “Bundled” will appear. By default they are left out. |
Show All Package Products |
When checked, zero-value “virtual bundle” parents will appear. By default they are left out. |
Quote Line Visibility |
When set to “Never” or “Editor Only” the line for the option is removed. |
Show Renewed Products |
When checked, non-subscription parent and siblings of a renewed subscription will appear on a renewal quote. By default they are left out. The results are affected by Show Bundled Products and Show All Package Products. |
Be aware, any lines hidden by Hide Component Products and Quote Line Visibility still contribute to the values shown in quote totals. If you use either of these, consider changing price-related line columns to use Package List Total and Package Total fields, which display the sum of the options and parent prices.
Hide Line Items Using Filtering
The premade checkboxes for hiding bundle- and renewal- related lines are nice, but quite limited. Thankfully there’s a sophisticated way of hiding lines based on any criteria you want. For example, let's say you don’t want to show quote lines if they are marked as Optional. Optional lines are meant to identify potential upsells, and don’t contribute to the quote total. You start by navigating to the template section for the line item content.
- In the navigation bar, click Quote Templates.
- Click AW Proposal.
- Click the Related tab.
- In the Sections related list, for the Line Items record, click Edit from the menu.
- For Filter Field, choose Optional.
This points to the out-of-the-box Optional quote-line field. You can add your own custom field if necessary. - For Filter Operator, choose equals.
- For Filter Value, enter
false
.
This tells CPQ to only show lines that are not checked as optional. - Click Save.
For Q-00053, the Tablet product was marked as optional, so it is now gone from the line item table.
Be aware, filtering products this way does not remove their value from quote totals. That’s OK for optional products since they never contribute value anyhow, but it’s possible to filter lines that do. If you filter out lines that have value, you may want to create a separate line item table that shows only those products you filtered so that the customer knows where the total quote value is coming from.
Phew, this was a long unit, but you did well! Now it’s time to check out other ways to add to your quote template, starting with custom Visualforce content.