Customers often ask for more than one quote when buying products or services. They compare the quotes' total prices and often spend more to get an additional discount. Alternatively, a sales representative can provide more than one quote to a customer to provide various options and close the deal faster. When the customer's budget is unknown, the sales rep will provide multiple quotes with different combinations of products and pricing. This chapter will help you understand how Salesforce CPQ can help create multiple quotes. You will also learn about the relationship between quotes, opportunities, and products or services, creating orders and returns in CPQ, and the advantages of using Salesforce CPQ Billing.
CPQ Billing can be used as an add-on to carry out end-to-end customer engagement that can be managed in Salesforce. Accounting systems can focus only on general ledger accounts. This facilitates having the end-to-end quote to cash process in Salesforce itself.
Upon completion of this chapter, you will be able to create an opportunity, associate it with a primary quote, submit the quote for approval, and complete the approval process. Optionally, you will also be able to create an order for the customer.
In this chapter, we will be covering the following topics:
Opportunities are potential revenue-generating deals for the sales org. They can be created from a lead conversion process, or a sales rep can create them manually from accounts in Salesforce. When a customer needs a quote, the sales rep can quickly use CPQ to generate the quote, add products using CPQ automation, generate the quote PDF, and then send it to the customer. If a customer already exists, then Salesforce amendments can be used. Chapter 7, Creating Contracts, Amendments, and Renewals, describes in detail amendments and renewals.
Let's learn how to create opportunities and quotes and add products in Salesforce CPQ.
Opportunities progress through different stages as the deal progresses from Prospecting to Closed Won or Closed Lost. Each opportunity stage is associated with a probability and these stages can be customized as per the business needs. As the stages progress, the probability of winning the sale will increase. We can also have a separate sales process for each type of sale (B2C versus B2B). These probabilities can also be used in sales forecasting.
For example, John Doe from Packt Communications is interested in buying laptops from you. Let's create an opportunity for Packt Communications:
In the Salesforce Lightning experience, interactive tools such as the sales path interactive visual representation can be used to track deal progress and close deals faster.
The following figure shows an opportunity created in Salesforce CPQ and the corresponding stages:
Each stage in the sales path can be marked as closed upon completion. The sales path can also be customized to show reps the mandatory fields that are required to move to the next stage level.
Now that you have created an opportunity, you are ready to create a quote.
A quote contains the information on all products and services, including the pricing details.
During the negotiation phase, multiple quotes can be created for an opportunity. At any point in time, only one quote can be made primary. The primary quote has a special relationship with the opportunity. When the quote is marked as primary (by selecting the Primary Quote checkbox), all the quote lines will automatically be synced to the opportunity product lines.
Products are goods and services that your company will be selling to its customers.
The following figure shows the relationship between Opportunity Quote Product:
In Figure 2.2, Quote 1 was initially marked as primary. Quote lines store the information about the products added to the quote. Products associated with Quote 1 will be synced to opportunity products. If the customer does not agree with the initial quote, they may ask to modify a few products or to make some changes to the product quantity of Quote 1. A sales rep can quickly create another quote and change that to the primary quote. When Quote 2 is marked as primary, all the products related to it will be synced to opportunity products.
Opportunity products contain information related to the products that you are selling, their quantity, price, discount details, and so on. You can add opportunity products as a related list to the opportunity page layout.
When a quote is marked as primary, Salesforce will sync the following fields from quote to opportunity products:
Additional fields can be synced by using the twin fields functionality. A twin field is CPQ functionality that can be used for certain objects. Two fields can be called twin fields when they have the same data type and API names. Creating a twin field will automatically sync the data from one object to the other. Creating a twin field between the quote line and the opportunity product line will automatically sync the quote line value to the opportunity product.
The total price (the TotalPrice API name) on the opportunity product is calculated by multiplying the opportunity product quantity by the sales price (Unit Price).
When a customer requests a quote, the sales rep can provide multiple quotes, as applicable, from the opportunity. In the next section, we will see how reps can create multiple quotes and how Salesforce administrators can configure the quote creation process as per specific business needs.
In this section, we will discuss the one-time prerequisite to enable permissions that CPQ admins perform after the package installation. When your customer asks for a quote, they are looking for details about the products and services that they are planning to buy. Sales reps can create and modify quotes as per the customer's requirements.
After installing the CPQ package, the Salesforce administrator needs to enable the Permission Set Licenses (PSLs) for configuring and customizing CPQ:
Figure 2.3 shows enabling PSL assignment to user John Doe in a Salesforce test environment:
Enabling PSL assignments is an important step and without this, the user will not be able to use CPQ.
Salesforce administrators can execute SOQL queries in the Developer Console Query Editor to view the list of PSL assignments either for Salesforce CPQ or AA. PSLs are not available for standard Salesforce reports.
Admins can run these queries in the Developer Console and view the results to see who has access to these PSLs:
select Assignee.Id, Assignee.Name,
PermissionSetLicense.MasterLabel from
PermissionSetLicenseAssign
Where PermissionSetLicense.MasterLabel in
('Salesforce CPQ License')
select Assignee.Id, Assignee.Name,
PermissionSetLicense.MasterLabel from
PermissionSetLicenseAssign
Where PermissionSetLicense.MasterLabel in
('Salesforce CPQ AA License')
The next step is to assign CPQ permission sets to specific users who need to access CPQ.
To do this, navigate to Setup Quick Find Users (select the user for whom you need to enable the permission sets) Permission Set Assignments Edit Assignments and add the Salesforce CPQ Admin and Salesforce CPQ User permission sets.
The CPQ object and field permissions (create, read, update, and delete) can be controlled by using the permission sets. Figure 2.4 shows an admin user who has been assigned both the Salesforce CPQ User and Salesforce CPQ Admin permission sets:
The Salesforce CPQ Admin permission set can be assigned to only admins who maintain the system. End users who are not administrators need only the Salesforce CPQ User permission set. These two permission sets must be manually adjusted to include the necessary objects and fields to perform the correct tasks.
After enabling CPQ configurations, you are now ready to create a CPQ quote. Admins need to enable these configurations for users, and this is a one-time implementation task. Let's see how reps can create a quote.
Salesforce administrators can assign PSLs to all the users who need to use CPQ. A CPQ quote can be created, modified, and edited using the Quote Line Editor (QLE). Implementation consultants and administrators can configure and customize the QLE in Salesforce. This will help reps to create quotes effectively and accurately. Any user with an active PSL and the CPQ permissions can now create a CPQ quote. Quotes are closely related to opportunities:
Mark the quote as Primary and click Save as shown here:
The filter icon can be used to show the search filter box while selecting products. This can be used to search by Product Code, Product Name, and Product Description by default. We can add or remove standard and custom fields by editing the product objects search filter field set.
Now that you have learned how to create opportunities and quotes and add products to quotes, in the next section, we will learn more about the QLE and how to configure and customize it.
The QLE is the user interface that Salesforce CPQ provides to reps for adding, deleting, and editing products. The QLE can be configured and customized as per your business needs. We can also apply discounts and markups and calculate the pricing.
Some of the Salesforce CPQ out-of-the-box QLE features that can be customized with configurations without using code are as follows:
Products can be grouped together and related product images can be associated as required.
The following figure shows a sample QLE with the quote header, quote line fields, and default buttons:
Using the QLE, changes can be made at the quote header or quote line level. Fields on the header are stored in the quote object and fields on the lines are stored in the quote line object.
Let's learn how to customize the quote line header and line fields using field sets and customize different column and field visibility, as well as sorting. We will also learn how to customize the out-of-the-box QLE buttons and create new buttons.
Fields that are displayed in the quote header or quote lines can be modified by customizing field sets.
Field sets are used to add or remove columns from the QLE. For example, based on the business process of your company, you may have a specific requirement where you want the sales rep to modify the start date and end date at the line level. Using the field set configuration, you can add these fields from the quote lines. To configure this in Salesforce CPQ, navigate to Setup Object Manager Quote Line Object Field Sets Line Editor, as shown here:
You can see the default available fields in the field set section of the QLE. You can also search for specific fields in the line editor and add those fields to the field sets. For example, if you would like to add the Start Date and End Date fields, search for them in the quick find, drag and drop the fields into the field set section, and click Save. In Figure 2.10, you can see that the start date and end date fields have been added to the quote line field set. This is similar to editing the Salesforce page layouts.
When you go back to the QLE and refresh the screen, you can see the new fields added.
Similarly, to customize the fields in the quote header section, the header field sets need to be configured. To configure quote header fields, navigate to Setup Object Manager Quote Field Sets Line Editor.
As per your business process, you can decide which fields are at the quote header level versus the line level. When there is a need for a particular field to be applied to all the lines, for example, the Additional Disc. field, we can add this to the header (the quote information section). Instead of editing each line of the quote, an update at the header level will apply to all the lines. A particular field can be added to both the quote header level and the line level. Sales reps can use these fields as required for editing.
The quote line object field set controls what columns are displayed in the QLE. When you add columns to a field set, these new columns will always be displayed. To dynamically change the visibility of these columns, we can use a list view or a formula field on the QLE header.
The quote field set controls what columns are displayed in the quote header section. Quote header columns can be dynamically changed using the Salesforce CPQ HeaderFieldSetName special field.
The QLE columns can be changed dynamically as per the business requirements using the Salesforce CPQ EditLinesFieldSetName special field.
For example, say your sales rep sells your product to both direct customers and distributors. When selling to distributors, you want to display an additional distributor discount field and this field should not be visible when you are selling to a direct customer. To do this, you can create a new custom view picklist value and add the None and Distributor_view picklist values. The rep can then manually select one of the picklist values in the QLE header, or this field can be automatically calculated based on a formula.
The following figure shows a sample QLE with a custom picklist view that can be used to dynamically change the quote line columns:
In the next section, we will see how administrators can configure the custom view values on the quote line header so that the quote line columns can be changed dynamically.
To change the QLE list view using a picklist value, create a new distributor view field set in the quote line object by navigating to Object Manager Quote Line Object Field Set Create New Field Set.
Create a new picklist value (custom view) on the quote object. Based on the picklist value, the QLE view can be changed dynamically. Set a field label and the field name as EditLinesFieldSetName. The picklist values for this field need to be the API names of the field set that you have created on the quote line object. Field set API names do not contain __C.
To make this picklist value available in the quote information section, navigate to the quote line object line editor field set and add this new picklist field. The user can change this picklist value manually to modify the field sets and display the columns accordingly.
To change the QLE list view automatically, instead of creating a picklist field, create a formula in the quote object and set the return type as text. Based on the formula evaluation output, the corresponding field set will be displayed for the user.
Quote line drawers can be used to reduce horizontal scrolling on the QLE when you have many columns. Drawers will help you create a collapsible view for QLE columns.
The following figure shows a sample QLE with quote line drawers; clicking the > symbol in the QLE opens the quote drawer and displays additional fields (such as Pricing Method and Original Price):
In the preceding figure, you can see that the important fields can be on the main view and the remaining fields can be moved to the drawer.
To create a drawer, navigate to Setup Object Manager Quote Line Object Field Sets Standard Line-Item Drawer. Add and delete QLE fields as needed.
The columns in the QLE can also be sorted by clicking the up arrow shown in Figure 2.12 next to the PRODUCT CODE field. Text columns can be sorted alphabetically, and numerical columns can be sorted ascending or descending. This feature is helpful for finding a specific quote line when there are a large number of lines.
These are the default buttons that the Salesforce CPQ package provides out of the box. Let's see what functionality each of these buttons provides and how we can use them:
A quote line group can be used to organize related quote lines. Quote line groups can also show multiple options for a customer to consider on one quote. All quote lines where the group's Optional field is set to TRUE are not synced to the opportunity and do not contribute to the quote total. Quote line groups are also useful if you are eventually shipping products to different locations or from different warehouses. CPQ+ has advanced order management, which will split a quote into multiple orders. To create a group, from the QLE, click Add Group. Within the group, click Add Products to open the product selection page and select all the products that you would like to add. All the existing quote lines are added to group 1. A quote line group is only available for the specific quote it has been created for.
Tip
Quote lines with groups cannot contain any ungrouped items.
Quote line groups do not transfer to an amendment or renewal, so should be used carefully.
To remove groups, you can click Ungroup.
Custom actions can be used to create custom buttons in the QLE. These buttons can be used to customize the QLE according to the business' needs. Using custom actions, we can create a subset of products and/or a filtered view of our products from the price book.
For example, you can create a custom action to show only regional-specific products.
Imagine, if your company is selling products in multiple regions, you can create a custom button such as US Products or EMEA Products, and show only those subsets of products. We will learn more about custom actions in Chapter 3, Configuring CPQ Products.
To enable the clone functionality, the CPQ package Enable Multi Line Delete setting must be selected. Select the clone icon to duplicate an existing line and reconfigure the product lines. We see that the quote line maintains all the field values and configurations. Any changes to the cloned quote line are not applicable to the original line.
Figure 2.14 shows a sample QLE with the Clone Line button:
When you have too many columns with long names, the column width can be adjusted as per the user's need to avoid horizontal scrolling. This feature was added as part of the Salesforce Summer '20 release. As we add more fields to the QLE, horizontal scrolling will be helpful.
To adjust the quote line field column width, drag the column (similar to Microsoft Excel) and save. Users can customize the layout by resizing the columns. The changes are saved automatically. Only columns can be resized and not rows. Also, the columns cannot be resized below a minimum width as users will lose complete visibility. Resizing columns will only apply to the field set you are editing and each field set needs to be resized separately. The column adjustments that you made can be reset back to the system defaults. Click on the gear icon on the QLE and click on Reset Column Widths:
To enable this feature, navigate to Setup Installed Packages CPQ Configure Line Editor Enable column resizing (checkbox).
You also need to give CRUD (Create, Read, Update, and Delete) permissions to the column metadata. Field set metadata object permissions are needed for the user profile.
In the next section, we will learn how to install and customize advanced approvals. When quotes created by reps need to be approved by a sales manager or a finance director, we will see how advanced approvals can be used.
The approval process in Salesforce defines how records are approved. For example, when the sales rep provides a discount that is over a certain threshold, based on your company's business process, the rep needs to get approval on the quote from the sales manager. In this section, we will learn about the approval processes available in Salesforce CPQ.
Salesforce provides two types of approvals: standard approvals and advanced approvals. Standard approvals are available as part of a Sales Cloud license. Advanced Approvals is an add-on license through Salesforce and is a part of the CPQ+ license. Let's look at these individually.
The standard approval process is linear in nature. The progression through the process is dictated based on the approval of the current step. When a quote is submitted for approval, it goes through a series of approvals from the sales manager to the finance director, as shown in the following figure:
In this process, if any approver rejects the quote, the sales reps will make changes to the quote. The quote will need to be resubmitted and all the approvers will need to reapprove the quote, which delays the process.
The approval process can be automated and customized using CPQ AA. For business scenarios with simple approval use cases, Salesforce standard approvals are usually sufficient. However, for businesses with complex approval workflows, CPQ offers AA; this allows a structure in which independent verticals, also known as chains, operate in parallel. These chains are independent of each other, and approvals can be triggered simultaneously for each chain.
AA works for any object in Salesforce, including standard and custom objects. Let's see an example of AA requiring approvals from multiple people, as shown here:
For example, if a quote needs multiple approvals from different stakeholders, as shown in Figure 2.17, it can be parallelly sent to all the approvers. The quote will be approved only if all the approvals within each chain are completed.
Reps can click the Preview Approvals button in the CPQ quote and view the status summary of the approvals.
Dynamic assignment of approvers is possible using advanced approvals. Following the process outlined in Figure 2.17, if the quote is submitted by a sales representative in the United States, it can be dynamically assigned to the United States sales manager. Similarly, if the same quote is submitted for approval by a sales rep in Europe, it can be automatically submitted to the European sales manager.
Using the smart approvals feature, if an approval is rejected by one of the approval members in the chain, Salesforce CPQ remembers the approval history. When the quote is resubmitted, the same users do not need to reapprove. Only the person who rejected the quote earlier needs to approve.
AA comes with a package that is built on top of Salesforce CPQ. AA comes with two permission sets: admins and users. Admins approve submissions and must be licensed users.
To use AA, we need to install the Salesforce AA package for our sandbox or production organization. CPQ installation is a prerequisite for installing AA. Follow these steps to install AA:
The Salesforce CPQ package enables AA for opportunities by default. In this section, you will see how Salesforce administrators can enable and configure AA for CPQ quotes:
AA for Other Standard or Custom Objects
The same instructions can be followed to enable AA for any other object. (Replace the quote with the object for which you want to enable AA.)
Navigate to Setup Object Manager Approval Object Fields & Relationships New Lookup Relationship Next Related to (Quote) Field Name (Quote) Next Make the field visible Next Save.
Navigate to Setup Object Manager Quote Fields & Relationships New Picklist Field Label (Approval Status) and set the API name as ApprovalStatus__c. Make sure that the API names match exactly and add the following picklist values, then click Next Save.
Lets add the following picklist values:
Figure 2.19 shows the ApprovalStatus picklist field creation in a Salesforce test instance:
QuoteExtController can be used in the Visualforce page where the admin can create the SubmitQuote and RecallQuote buttons:
public with sharing class QuoteExtController {
private Id quoteId;
public QuoteExtController(ApexPages
.StandardController stdController) {
quoteId = stdController.getId();
}
public PageReference onSubmit() {
if (quoteId != null) {
SBAA.ApprovalAPI.submit(quoteId,
SBAA__Approval__c.Quote__c);
}
return new PageReference('/' + quoteId);
}
public PageReference onRecall() {
if (quoteId != null) {
SBAA.ApprovalAPI.recall(quoteId,
SBAA__Approval__c.Quote__c);
}
return new PageReference('/' + quoteId);
}
}
This test class will help the Salesforce administrator to deploy the QuoteExtController code to the Salesforce production instance:
@isTest
private class QuoteExtControllerTests {testMethod
static void testSubmit() {
SBQQ__Quote__c quote = new SBQQ__Quote__c();
insert quote; Test.startTest();
QuoteExtController con = new
QuoteExtController(newApexPages
.StandardController(quote));
con.onSubmit();
quote = [SELECT ApprovalStatus__c FROM
SBQQ__Quote__c WHERE Id = :quote.Id LIMIT 1];
Test.stopTest(); System.assertEquals
('Approved', quote.ApprovalStatus__c);
} testMethod static void testRecall() {
SBQQ__Quote__c quote = new SBQQ__Quote__c();
insert quote; Test.startTest();
QuoteExtController con = new QuoteExtController
(new ApexPages.StandardController(quote));
con.onRecall();
quote = [SELECT ApprovalStatus__c FROM
SBQQ__Quote__c WHERE Id = :quote.Id LIMIT 1];
Test.stopTest();
System.assertEquals('Recalled',
quote.ApprovalStatus__c);
}
}
We are now ready to create the Visualforce pages for submitting and recalling a quote. Next, we can add buttons to submit a quote for approval, recall a submitted quote, and preview the approval process. Let's learn how an admin can configure AA and add these buttons to the quote page layout.
Sales reps can use AA buttons to submit a quote for approval, recall an already submitted approval, or preview the approval status. These buttons will be available on the CPQ quote object. Let's learn how to create these buttons using CPQ configurations:
<apex:page standardController="SBQQ__Quote__c"
extensions="QuoteExtController" action="{!onSubmit}">
<apex:pageMessages />
</apex:page>
<apex:page standardController="SBQQ__Quote__c"
extensions="QuoteExtController" action="{!onRecall}">
<apex:pageMessages />
</apex:page>
A Salesforce admin can create a Submit for Approval button as shown in Figure 2.20. End users can use these buttons on the quote record to perform the corresponding actions. The following settings should be filled in:
Create the Recall Approval button as shown in Figure 2.21:
Create the Preview Approval button as shown in Figure 2.22. Clicking this button on the quote object will redirect the user to the CPQ Preview Approvals page and pass the quote ID as the parameter:
As shown in Figure 2.23, we see two Submit for Approval buttons: one is the standard button and the other is a custom button for CPQ approvals.
Once a record is submitted for approval, the approver can respond with an email that automatically approves or rejects the record. The keyword for approval or rejection can be set in the AA package configuration.
To set up the approval keyword for your Salesforce organization, navigate to Setup Quick Find Installed Package Advanced Approvals Configure to set up the Approved Keywords (for example, Approved, Approve, Yes) and Rejected Keywords (for example, Rejected, Reject, Decline, No).
Approvers can respond to emails with these keywords for approvals and rejections.
Setting an email service and email service address is a prerequisite for applying the email responses to AA. This email service will help approvers to receive notifications in their mailbox and they can use the keywords in their responses. The corresponding record in Salesforce will be updated with an approved status or rejected status based on the response. To configure the email service, follow these steps:
Refer to Figure 2.24 for the email service configuration:
The preceding approval service is set up to accept emails from Gmail. You can add other service providers, such as Yahoo or Hotmail, as needed. The email service created in Figure 2.24 needs to be linked to the CPQ AA package setting.
Enable Error Routing
When email services cannot process an incoming email, enabling error routing in the failure response settings sends an error message to the email specified in the Route Error Emails to This Email Address field.
To enable email approvals, copy the email address from the email service in Figure 2.24 and update this email address in the AA approval package configuration.
Navigate to Setup Quick Find Installed Packages Advanced Approvals Configure and paste the email address in the Inbound Approval Email (Long) field and save the changes.
Visualforce AA email templates need to be configured to send the AA process email in response to an approval request, rejection, recall, or approval. It's recommended to create a separate email template for each of these actions. In this example, we will walk through creating an email template for setting up a request email. You can follow these same steps for creating email templates for the remaining actions:
Set the following fields:
The AA approval email template is now ready to use.
Once AA is configured for the quote object, the approval rules can be created as per the business needs. Installing AA creates all the related components from the package, including a few main objects:
Let's see how an admin can configure approvals using these CPQ objects.
To create an approver, navigate to the approver object and click on New. Fill in the approver name. Then, update the User field, either with a single user or a user group. You can also use a delegated approver if the primary approver is on vacation.
Let's look at creating an approval rule, condition, and chain. Based on the business criteria for approvals, these configurations can be customized. When the rep adds the products to the QLE, CPQ AA will trigger in the backend. Records that need approval will be assigned to the approver automatically and the quote status will be pending approval until the approvals are completed.
To create an approval rule, navigate to App Launcher Approval Rules New
and follow these steps:
Approval chains can send approvals to several approvers in a sequence or in parallel paths.
To define an approval condition, navigate to App Launcher Approval Rules Related Approval Conditions New. Then, follow these steps:
To create an approval chain, navigate to the App Launcher Approval Chains New.
Provide the chain name. In the target object name, provide the object for which you want to run the approval process. Click Save.
After the quote is approved, the sales rep can create an order for the customer. In the next section, we will learn about CPQ order management.
When a customer is ready to order, an order can be created from the quote. Orders contain order products for each of your quote lines. Creating orders is a prerequisite for using Salesforce Billing. Orders are also a great location for integrations with other services beyond Salesforce Billing. You can create invoices from an order object using Salesforce Billing. We will learn more about Salesforce Billing in Chapter 10, Salesforce Billing.
Advanced order management is available for customers who buy CPQ+ licenses. With this feature, a business can provide a single quote for multiple orders, making it possible for the business to deliver the shipment to multiple locations at different times. In addition, an order object can be used to activate subscriptions after their implementation.
Before users can create orders, Salesforce admins need to perform a one-time activity: enabling orders at the org level. To enable orders, log in to your Salesforce org and navigate to Setup Quick Find Orders Enable Orders Save.
Orders must also be configured to support negative quantity lines. To do this, navigate to Setup Quick Find Order Settings Enable Negative Quantity.
Use Salesforce profiles or permission sets to assign user and object permissions to the appropriate users. Orders can be disabled to hide order-related data. To access the data again, re-enable orders.
Orders must be created from a primary quote. The primary quote cannot be modified after an order is created. List price, unit price, and the total price will be inherited from quote to order. Orders can be created using the Create Order button on an opportunity or quote. Alternatively, setting the Ordered field to True on an opportunity or quote and saving the record will automatically create an order.
For an end-to-end solution on quote-to-cash automation, both order management and Salesforce Billing can provide a lot of advantages and shorten the sales cycle.
This chapter helped you understand how you can create an opportunity, quote, and quote line items. You also learned when AA can be applied for a quote object. By applying the approval rules to CPQ quotes at various stages, you can speed up the whole approval process, as well as customize the CPQ package as per your business needs. The QLE interface helps you to create quotes easily and accurately. You have also seen the advantages of implementing orders and how to enable orders.
In the next chapter, you will learn how to configure product bundles and further automation related to product configurations.
3.144.107.193