Salesforce CPQ: Conditional Quote Subtotals

  • Blog
  • Salesforce CPQ: Conditional Quote Subtotals
16
Feb

In a previous blog post, we discussed about adding quote subtotals to the quote:

List Total, Regular Total, Amount Total, and Net Total. 

Salesforce CPQ Quote Preview

Regular Total and Discount Total are not always necessary because we're not always going to apply discount schedules or some additional discounts. It would make sense to make them appear when there is actually a discount applied, when there's a difference. 

We can make them appear conditionally. To achieve this, we have to create some formula fields on the quote because that's where all of the conditional print fields are driven from. 

First, go to Setup > Object Manager > Quote > Fields and Relationships and create a new field. This is going to be a formula field. Name it Display Regular Total with the return to checkbox.

Salesforce CPQ Fields & Relationships for Quote Object in Setup

The formula that we need here should say whether there is any difference between the list price and the regular price. Click Insert Field to find the necessary fields. So, if the Regular Amount does not equal to the List Amount, return true, else false. The formula should look like this:

IF ( SBQQ__RegularAmount__c <> SBQQ__ListAmount__c , TRUE, FALSE )

Check the syntax to make sure there are no errors.

Salesforce CPQ New Custom Field Advanced Formula

Click NextNextSave and New.

Create the second formula field: Display Discount Total, again with the return to checkbox. This time, we'll check whether the Customer Amount is not equal to Regular Amount. If that's true, it means we have some kind of discount applied. So, the formula field will return true if that's the case and false otherwise. 

IF ( SBQQ__CustomerAmount__c <> SBQQ__RegularAmount__c, TRUE, FALSE )

Again, don't forget to check the syntax for errors.

Now, go back to the corresponding sections and update the conditional print fields so that they are actually driven based on these two checkboxes.

Go to Setup > Object Manager > Template Section > Fields and Relationships. Find the Conditional Print Field and click New in Values. Paste here the two API names of the Display Regular Total and Display Discount Total fields. Click Save and close the tab.

Salesforce CPQ Conditional Print Field Overview in Quote Template Section

Then, go back to the Sections, refresh and choose the right conditional print field. Thus, Regular Amount is going to be driven by Display Regular Total, and the Discount Amount section is going to be driven by Display Discount Total.

Salesforce CPQ Edit Regular Ammount Options For Quote Object

Now you can test this out by previewing the document to make sure everything is behaving as expected.

Salesforce CPQ Conditional Quote Subtotals Preview

 

Comments (0)

Leave a Comment