How to Create a Custom CPQ Solution in Zoho CRM

Discover how to take control of your sales process with a custom CPQ (Configure, Price, Quote) solution in Zoho CRM. Learn step-by-step methods to tailor your quoting process, automate calculations, and optimize sales efficiency for a seamless customer experience.

Published on February 27, 2024

Share This Post
Enhancing Data Integrity
  • Who is this feature for?
  • Sales professionals
  • CRM administrators and developers
  • Sales operations managers
  • What progress will you accomplish?
  • Increase sales efficiency and improve quote accuracyEnhanced cross-selling and upselling opportunitiesFaster quote approvals and sign-offs

Introduction

This tutorial aims to demonstrate how to create a truly customized CPQ process, perfectly tailored to meet your business’s specific needs. While Zoho CRM has an upcoming CPQ feature, its capacity may be limited. [You can read more about this upcoming CPQ solution here: https://www.zoho.com/crm/cpq.html]

However, this feature has inherent limitations in meeting specific business requirements. This tutorial is dedicated to guiding you through the process of creating a truly customized CPQ solution within Zoho CRM, empowering your business to adapt the system precisely to its unique needs and workflows.

Let’s dive in and unlock the full potential of your sales process with Zoho CRM.

Creating Quotes in Zoho CRM

Zoho CRM comes with a user-friendly and powerful quote-creation feature. With its intuitive interface, customizable templates, and seamless integration capabilities, Zoho CRM empowers sales teams to efficiently generate accurate, professional quotes.

Please adhere to the subsequent steps to generate a quote within Zoho CRM.

Access your Zoho CRM account and navigate to the Quotes section. Then, select Create a Quote.

Begin by providing a Subject for the quote and proceed to select a Deal Name, Account Name, and other quote details.

Upon completing the quote information, proceed to add Quoted Items by clicking on the option to Add products or Create new products using the + New Product button. Provide the necessary details, such as the Product Name, Unit Price, and other pertinent information.

Once you have quickly created a product, save the changes by selecting Save and Associate. For adding additional products, use the + Add row option.

Once you have finished writing the quote, click on the Save button to save the quote.

Exporting quotes in a CSV file

We need a CSV file with Quotes data from Zoho CRM for the Zoho Writer template incorporating relevant fields from the Quotes module.

[Note: This is a one-time process for initial setup.]

To export the CSV file containing your quotes data in Zoho CRM, access the Setup section, navigate to Data Administration, and then click on Export.

Choose Quotes as the Export Module and proceed to click on the Export option. This action will initiate the exportation of your CSV file containing the quotes data.

Creating a Zoho Writer Template with Zoho Sign Integration from Zoho CRM Data

The next step involves sending quotes to our customers for review and confirmation. To achieve this, we will generate a custom template utilizing data extracted from the Quotes module of Zoho CRM.

Launch Zoho Writer and select the + Create New option. Proceed to access Merge Templates and then click on Create from Scratch.

Provide a name for your template, then click on Options and navigate to Automation. From this point, select a data source for your Zoho Writer template.

As Zoho CRM only supports data integration from specific modules (Leads, Contacts, Accounts, and Deals), we must import a CSV file to integrate the template with Quotes Module data. To proceed, click on Import CSV or JSON, choose a CSV file, and then click on Open.

Manage the fields accordingly and populate the template with quote fields. To finalize the template, click on Preview Merge to preview the document.

Once you have written and populated the template with merge fields, proceed to choose an output. For our specific purpose, opt for Merge & Send for sign collection.

Input the required Signer details, including the Signer’s email, name, and other relevant information. Assign your document’s name, and click Save to complete the process.

Upon completing the template and data finalization, click on Save Settings.

Sending Quotes for customer signature and tracking progress

The Quotes data in the template will be sent to the signer by clicking on Run Merge. Proceed to select Run Merge and then click on Send for Collection.

Once the merge is initiated, click on View Log to monitor the progress of the document sent for signing.

The signer will open the email, proceed to the document by clicking on Proceed to document, then select Agree & Continue. After writing their signature and clicking the OK button, they will finalize the signing process by clicking on the Finish button.

On the View Log page, you can refresh the log to obtain updates regarding your document sent for signing. Simply click on Refresh, and the status will be displayed as Completed, confirming that the signer has successfully signed the document.

Automating Invoice Generation in Zoho Books from Zoho CRM Quotes

To automate the invoice creation process in Zoho Books, we will employ workflow rules along with custom functions within Zoho CRM.

To begin, access Zoho CRM and navigate to Setup. From there, head to Automation and select Workflow Rules.

Click on the + Create Rule option and choose the Module that this workflow rule pertains to. Provide a name in the Rule Name field, and proceed by clicking Next.

Next, choose the execution criteria for this workflow. Under Execute this workflow rule based on, opt for Record action – Edit, and then select Repeat this workflow whenever a Quote is edited.

Modify Any field gets modified to the Specific field(s) get modified. Proceed by selecting When Quote Stage is modified to the value Confirmed and click Next.

Thus far, we have established the execution parameters for the workflow rule. Now, let’s define a condition. In the Condition 1 box, choose Quotes matching certain conditions to specify the quotes to which the rule should be applied.

Select Quote Status is Confirmed and proceed by clicking Next. When a customer signs the quote, its status will be marked as Confirmed, triggering the execution of this workflow rule whenever the quote’s status is edited to Confirmed.

To ensure instant action, we’ll choose Function under Instant Actions. Click on + New Function to create a custom function for this workflow rule.

From the Configure Function screen, select Write your own and provide a Function Name and Display Name for your function. Click on Create to finalize the process.

Once you’ve created the function, it’s time to write the script. Copy the provided code and paste it into the function.


respInvoice = zoho.crm.getRecordById(“Quotes”,input.quoteid.toLong());

acctid = ifnull(respInvoice.get(“Account_Name”),””).get(“id”);

invoiceno = ifnull(respInvoice.get(“Quote_Number”),””);

acctsearch = getUrl(“https://books.zoho.com/api/v3/contacts?organization_id=xxxx&authtoken=yyyy&zcrm_account_id=” + acctid);

resp_Map = acctsearch.toMap();

contactstring = resp_Map.get(“contacts”);

contactList = contactstring.toJSONList();

for each  rec in contactList

{

custId = rec.getJSON(“contact_id”).toLong();

}

products = respInvoice.get(“Product_Details”).toJSONList();

totaldisc = 0.0;

count = 0;

lineItemstr = “[“;

for each  product in products

{

count = count + 1;

Quantity = product.get(“quantity”).toLong();

List_Price = ifnull(product.get(“list_price”),”0.0″).toDecimal();

disc = ifnull(product.get(“discount”),”0.0″).toDecimal();

totaldisc = totaldisc + disc;

productvalue = product.get(“product”);

Product_details = productvalue.get(“name”);

lineItem = “{\”name\” :\”” + Product_details + “\”,\”rate\”:” + List_Price + “,\”discount\”:” + disc + “,\”item_order\” : \”” + count + “\”,\”quantity\”:” + Quantity + “},”;

lineItemstr = lineItemstr + lineItem;

}

lineItemstr = removeLastOccurence(lineItemstr,”,”);

lineItemstr = lineItemstr + “]”;

jsonMap = Map();

jsonMap.put(“customer_id”,custId);

jsonMap.put(“line_items”,lineItemstr);

jsonMap.put(“date”,today);

jsonMap.put(“due_date”,today);

jsonMap.put(“salesorder_number”,invoiceno);

createinvoices = zoho.books.createRecord(“SalesOrders”,”xxxxxxx”,jsonMap);

info createinvoices;

[Note: To enable the execution of this function, you will require an Organization ID and an authtoken. We will guide you on obtaining them in the later stages of this article.]

This function retrieves the quote based on the Quote ID. To do this, click on Edit Arguments. Enter quoteid as the Key and # in the Parameter Value field.

Choose Quotes as the Module and Quote ID as the Field. Confirm by clicking Done and then select the argument by clicking Save.

Once you have configured the function, click on Save to create it. Then, click on Save again to finalize and save the workflow rule.

Obtaining ‘authtoken’ and ‘Organization Id’ for Custom Function

Obtaining the Organization ID is straightforward, but generating an authtoken requires four essential elements: Client ID, Client Secret, Redirect URI, and Code.

To obtain the Organization ID for our custom function, start by accessing Zoho Books. Log in to your account, click on your Profile, and then simply copy the Organization ID.

Please be aware that generating an authtoken is no longer possible through a single link, as the process has changed. Zoho now follows the OAuth 2.0 protocol to generate authtokens or access tokens.

In order to obtain the Client ID and Client Secret, you must register a client. You can follow the link provided below to register a new client.

Follow the link and click on Create New Client. Choose Server-based Applications as the Client type. Enter your desired Client Name, and use ‘http://www.zoho.com/books‘ as both your Homepage URL and Authorized Redirect URIs.

Click on Create, and your Client ID and Client Secret will be generated. Don’t forget to copy and save them for future reference.

Next, use your client information to modify the following link and generate a code. Replace xxxx with ZohoBooks.invoices.CREATE,ZohoBooks.invoices.READ,ZohoBooks.invoices.UPDATE,ZohoBooks.invoices.DELETE, and yyyy with your Client ID, as well as zzzz with your Authorized Redirect URIs in the provided link:

Once you’ve made the necessary modifications and accessed the link through a browser, a confirmation page will appear.

Click on Accept and then copy the ‘code‘ from the URL generated after clicking Accept. Remember to save this code promptly, as it remains valid for only one minute.

If the code expires before generating the authtoken, you will need to repeat the process to obtain a new code.

The code link will appear similar to the following:

Next, you’ll require software such as Postman to create a POST link for generating the authtoken.

To proceed, open the software (in this case, we are using Postman) and click on Import. Then, paste the following link:

curl “https://accounts.zoho.com/oauth/v2/token?code=xxxx&client_id=xxxx&client_secret=xxxx&redirect_uri=http://www.zoho.com/books&grant_type=authorization_code

After pasting the link, press Enter to initiate the process.

Postman will dissect the link for easy configuration. Switch the method from Get to Post and include the necessary information such as Client ID, Client Secret, and Code. Then, click on Send to proceed with the request.

If you encounter an error, it indicates that your code has expired. Generate a new one and try the process again. Upon successful execution, the response from the POST request will resemble the following:


{

“access_token”: “1000.b636b02765731c5287bc66d651008af8.61cd65050dbad6192d4f05789f321858”,

“refresh_token”: “1000.a0ed01f17b12dcf1decf097d3408ce5d.1c64efea3b2f4f4e8a2a7c0431a3fbd6”,

“scope”: “ZohoBooks.invoices.CREATE ZohoBooks.invoices.READ ZohoBooks.invoices.UPDATE ZohoBooks.invoices.DELETE”,

“api_domain”: “https://www.zohoapis.com“,

“token_type”: “Bearer”,

“expires_in”: 3600

}

Copy the access token from this location and paste it into your custom function, then save it.

Since the response to our POST request includes a refresh token, you can utilize it when your access token expires.

Utilize the following link in Postman, input the necessary information, and make a Post request to refresh your token.

Link: https://accounts.zoho.com/oauth/v2/token?refresh_token=xxxx&client_id=xxxx&client_secret=xxxx&redirect_uri=http://www.zoho.com/books&grant_type=refresh_token

The response will be as follows, and the provided access token is your new authtoken:


{

“access_token”: “1000.ad70e46caaa832348dffce066c51e3b0.cc4e9194d78b9031178803be4f654f87″,

“scope”: “ZohoBooks.invoices.CREATE ZohoBooks.invoices.READ ZohoBooks.invoices.UPDATE ZohoBooks.invoices.DELETE”,

“api_domain”: “https://www.zohoapis.com“,

“token_type”: “Bearer”,

“expires_in”: 3600

}

Putting It All Together

Once the custom function has been written successfully and granted access to modify the Invoices module in Zoho Books, we will proceed to save the function and finalize the workflow rule.

Subsequently, when our client signs the quote, we will update the quote status to Confirmed, triggering the workflow rule to execute the function we created.

Upon refreshing, you will observe a new invoice generated in Zoho Books Invoices, based on the data from the Quotes module in Zoho CRM.

What Pain Points Does It Solve?

This article addresses several pain points related to sales operations and quoting processes:

  1. Manual Document Management: By integrating Zoho Writer templates with Zoho Sign, the article helps eliminate the pain of manually handling documents for signing and tracking, making the process efficient and seamless.
  2. Inefficient Invoice Generation: Automating the invoice generation process in Zoho Books from Zoho CRM quotes resolves the pain of manual invoicing, reducing errors and delays in billing customers.
  3. Lack of Personalization: With a custom CPQ solution, businesses can tailor quotes and offerings to meet individual customer needs, providing a more personalized and satisfactory experience.
  4. Sales Workflow Bottlenecks: The article guides users on automating workflows, reducing bottlenecks in the sales process, and increasing overall sales efficiency.
  5. Inaccurate Quotes: By creating a custom CPQ solution, the article helps ensure that quotes are accurate, consistent, and adhere to predefined pricing rules, minimizing errors and discrepancies.
  6. Limited Sales Productivity: The integration of Zoho CRM with Zoho Books boosts sales productivity by simplifying tasks and enabling sales representatives to focus on closing deals.

By addressing these pain points, the article empowers businesses to optimize their sales operations, enhance efficiency, and deliver a more satisfying experience to both sales teams and customers.

Conclusion

With a personalized CPQ solution in Zoho CRM, you can streamline your sales operations, enhance efficiency, and provide a tailored experience for your customers.

By automating key processes and integrating Zoho CRM data with Zoho Books, you’re ready to unlock the full potential of your sales process and achieve greater success. Let your business thrive with the power of Zoho CRM and take your sales to new heights.

Recent Posts
  • Zoho CRM Next Gen UI: Using the Interactions Tab
  • How to Navigate the Next Gen UI of Zoho CRM?
  • Zoho CRM: Comprehensive Guide to Team Modules
  • The Ultimate Guide to Teamspaces in Zoho CRM for Everyone
Share This Post

Related Posts

Discover the latest news and updates on Zoho applications.

Unlock Your Knowledge Journey!

Get three articles for free, then enjoy unlimited access by registering.