Using QCP in Salesforce CPQ

May 18, 2018 Isha Shukla

Abstract fast-moving data on how to use QCP in Salesforce CPQMany companies are looking forward to implementing Salesforce CPQ (Configure Price Quote). Although CPQ software has been available for decades, Salesforce’s CPQ development is part of the newest wave in sales optimization tools. 

What used to happen before CPQ?

  • The sales representative needed to figure out what products worked best by understanding and analyzing an individual customer’s needs and preferences.
  • Sales reps consulted pricing spreadsheets or documents to obtain the base price.
  • Sales reps then would manually apply discounts, according to the client eligibility factors. They would need to request internal approval if required.

This antiquated process had a number of drawbacks, including inaccuracies, loss of time and money, and unapproved discounting. This sets a bad precedent for customers and considerably reduces business profit margins.

How does Salesforce CPQ help?

  • Configuration with guided selling: By answering a few simple questions about the customers, sales reps can make configurations to sell related products together.
  • Automation in pricing and discounts: CPQ has the ability to customize Price Rules, based on conditions and advanced calculators (QCP). 
  • One-click quote generation: CPQ allows for customizable templates that includes dynamic quote terms.
  • Contract management: CPQ can handle the renewal process and allows for e-signature integration.

Ultimately, Salesforce CPQ empowers the sales team to create quotes quickly, with less effort and minimal errors.

Now let’s dive into what the Quote Calculator Plugin (QCP) is and how it works with and compliments CPQ.

How does QCP work with CPQ?

Salesforce CPQ offers a powerful inbuilt pricing engine, which can be configured and customized extensively. However, sometimes in large organizations, where the pricing is not straightforward or there is large data to process, then the CPQ process can get tied up easily. QCP is the solution in such scenarios 

It not only gives the flexibility to use price rules and other developed Salesforce features, but also gives admins and developers the flexibility to add a Javascript or Apex code snippet to achieve business logic — but this might not be feasible using simple price rules.

Scenarios where QCP can be used: 

  • Complicated product-bundling guidelines
  • Conditional and complex pricing logic that’s impossible to achieve through existing Salesforce CPQ pricing configurations
  • Prevention from occlusion of the pricing engine, due to processing of large volumes of price rule or workflow data

How to implement QCP in Salesforce (Steelbrick) CPQ?

On the basis of any field value on Quote level, we can calculate Partner Discount for a product. Here, the ‘Country’ field on quote object will conditionally calculate discount on product at quote line level, which varies from one location to the other.

The image below is the CPQ pricing engine implementation, using Price Rules and Lookup tables (managed object provided by Salesforce CPQ ).

We have developed the above scenario through price rule. But what if we have an organization with 10,000 products sold in ten different countries? The lookup data expands to as many as 100,000 records. And when the pricing engine scans the tables with these many records, sometimes can have a delayed or no response. 
With the additional assistance of QCP, the query results are returned faster, because it doesn't need to process internal optimization (which a pricing engine does otherwise). Also, QCP offers the ability to break quote lines into chunks, based on requirements.

Two ways to implement QCP 

1. Apex Legacy QuoteCalculatorPlugin 

Create an apex class for further customizing quote calculations. This class must implement the QuoteCalculatorPlugin and QuoteCalculatorPlugin2 interfaces.

Navigate to the calculator plugin:

 Setup > Installed Packages > Configure “Salesforce CPQ”  

  1. Pricing and calculation tab > legacy calculator:  True
  2. Plugin tab > Legacy QuoteCalculatorPlugin: {Name of Apex Class}


  • Runs the server side, so when calculations are made, they’re made in the Salesforce instance
  • It’s easier to access Salesforce objects and fields from within Apex
  • When a user reports a problem, dev can review debug logs in the Salesforce instance


  • Since the Calculator runs in the Salesforce instance, performance may become an issue during more complex quotes or requirements
  • Requires an Apex test class and deployment from a Salesforce sandbox. 

2. Javascript Advanced QuoteCalculatorPlugin
Javascript resides in a Custom Script managed package object. Create a custom Javascript form.

Navigate to use the calculator plugin: 

Setup > Installed Packages > Configure “Salesforce CPQ” > Plugin tab > Quote Calculator Plugin: {name of custom script}


  • Quicker results.
  • Script runs locally in the user’s browser
  • Local debugging can be done using the browser’s debugging tools
  • No test class is required to deploy


  • Not all field relationships are available in the Quote Calculator, by default
  • Price Rules might have to be rewritten to handle the new Quote Calculator

We’ve helpfully provided a Javascript code segment to highlight the above example. 

 Key Takeaways

  1. Salesforce CPQ streamlines the quoting process and reduces the financial risk in the sales cycle. This gives sales reps the ability to do their job efficiently and accurately.
  2. The quote calculator significantly eases the amount of work going into business scenarios that deal with bulk data records and complex pricing. This helps developers deliver solutions that cater to the Customer Experience.

Read here to gain better insights into Salesforce CPQ and how to leverage its capabilities before structuring the sales cycle for your organization. Learn more about our Salesforce Consulting Services or visit the Appirio hub for resources.

Previous Article
How to Create Effective Automatable Test Cases
How to Create Effective Automatable Test Cases

Learn how to properly detail each test step while creating effective automatable test cases.

Next Article
How to Build Code-free Dynamic Emails with Marketing Cloud
How to Build Code-free Dynamic Emails with Marketing Cloud