Hello everyone!
We're back with another post in the Kaizen series.
We're grateful for the feedback we received from all of you!
One of the questions we received was "I would like to see the list of Purchase Orders in Zoho Books for a Deal in CRM."
We will discuss how to achieve this using the Queries feature in Zoho CRM.
Scenario
In many organizations, a single Deal in Zoho CRM may correspond to one or more Purchase Orders(POs) in Zoho Books. To get a real-time view of all POs associated with a Deal in CRM, we can leverage the Queries feature under Setup > Developer Hub > Queries, and custom related lists.
1. CRM and Zoho Books Integration
Zoho CRM and Books integration allows you to
- View POs, invoices, and payments for deals directly in CRM
- Synchronize financial data between CRM deals and Books POs
- Automate the mapping of deals to POs via custom fields
- Go to Setup > Developer Hub > Connections
- Create a connection to Books(OAuth) with the scopes ZohoBooks.contacts.All and ZohoBooks.purchaseorders.All.

2. Prerequisites
Before creating the query and automation, you must have the following ready:
- Zoho Books organization ID – needed for REST API calls.
- Custom field in Books PO module:
Field Name: CRM Deal ID
Type: Single-line
Purpose: Store the CRM deal ID that each PO relates to.
Why do we need this custom field?
By default, Books POs are not directly linked to CRM Deals. To bridge this gap, we create a custom single-line field(CRM Deal ID) in Books POs to store the CRM Deal’s record ID. This makes it possible to filter POs in queries(cf_crm_deal_id == {{deal_ID}}) and reliably display only the related POs in CRM.

You can store the record ID of the deal in CRM in this field either manually or via a custom function. When you use a custom function, use the Update a Purchase Order API to update the CRM Deal ID field in Books with the record ID of the deal in CRM. You can then associate this function to a button or automation to constantly update the PO in Books every time a deal in CRM is created or updated in CRM. You can also use Zoho Flow to achieve this instead of a function. - Trusted domain and source:
- Ensure you have added Books API domain to trusted domain for API calls.

- Add Zoho Books as the source of the query to get the PO details from Books. You can add the Books' organization ID as a parameter either here or while creating the query.

3. Single Deal, Multiple POs
Scenario
- A CRM deal requires multiple POs from different vendors.
- Each PO in Books stores the same Deal ID in the CRM Deal ID field.
- This allows a related list in CRM to show all POs associated with the deal.
Why a Single-line Field Works?
- Each PO references one deal.
- Queries in CRM can filter using cf_crm_deal_id == {{deal_ID}}. cf_crm_deal_id is the API name of the custom field in PO of Books. You can find it under Setup > Purchases > Purchase Orders > {the custom field} > Edit.
- Works reliably for related list display.
4. Creating a REST API Query in CRM
Since we will use Books API to get the list of POs, we will create a REST API type query.
- Go to Setup > Developer Hub > Queries > Create Query.
- Enter the details as shown in the following image:

- Choose the Books source that you added recently.
- Give a name for the query.
- The API name will be auto-populated, and the URL will be populated from the source.
- Enter the endpoint to access the resource from Books. In our case, purchaseorders.
- To filter based on the value in the CRM Deal ID field in Books, enter the parameter as cf_crm_deal_id and its value as a variable. This variable takes the Deal's record ID as the value during run time. This ensures that the query takes the deal residing in the CRM Deal ID(which is also the record ID of the deal in CRM) field in Books and filters only those POs related to this Deal.
- If you have not given org_id as a parameter while creating the source, include it here.
- Click Next. You will get a pop-up asking for the value to the variable cf_crm_deal_id. Give a value to see the query in action.
- The query returns the list of POs from Books that are related to this particular deal in CRM.
- Save the query.
5. Serializing(to return a table for the related list)
Serializer allows you to manipulate the response of the query using Javascript.
In our example, the raw response of the query will contain the POs from Books for a deal in CRM as an array with many fields.
For example, the deal with CRM record ID 3652397000017912047 has two POs in Books viz, PO-00001 and PO-00003. The raw response before serialization is as follows.
But, to associate this response with a related list, we don't need all the fields. We can use the serializer to modify this response and use only the required fields.
The following image shows the serialized response.
Click Save and configure the Schema.

Click Save to save the query.
6. Adding the Query to a Related List
Now that we have the query ready, let's associate this with a related list in the Deals module in CRM to contextually view the POs of the Deal in Books.
- Navigate to the Deals module in CRM.
- Click the three-dot icon on the right corner of the record, and click Add Related List. Alternatively, you can also click the Add Related List option on the left in the Related List pane.

- From the pop-up, select Queries.

- From the list of available queries, select the Get Purchase Orders query you created and click Associate.

- Give a name for the related list.
- Under Variable Mapping, type #(to view merge fields) to get the list of modules available. Choose Deals and the Deal Id field. This means that the record ID of the deal will be passed as the value of the cf_crm_deal_id variable at runtime. The query will then fetch the list of POs for this Deal ID from Books, and display it in this related list.

- Click Save and you will see the related list under the Related Lists section of the record.

- Reload the page to see the query in action.

Automation Options
You can automatically update the CRM Deal ID in Books POs when a deal is created or a PO is raised.
1. Using Function
- Function triggers on deal creation or a button click in CRM.
- Fetches the PO in Books and updates the CRM Deal ID field using the Books connection.
2. Using Zoho Flow
- Event: Deal created or updated in CRM.
- Action: Update the corresponding PO(s) in Books.
- Works without writing Deluge code.
Both methods require the Books connection and organization ID.
Summary/Best Practices
- Single Deal, Multiple POs: Use single-line CRM Deal ID field in Books.
- Queries and serializer: Filter POs based on cf_crm_deal_id == {{deal_ID}}.
- Automation: Use functions or Zoho Flow for real-time updates.
- Multi-Deal, Single PO: Not supported for related lists; use custom reporting instead.
This setup ensures that sales and finance teams can see all POs for a deal directly in CRM without manual reconciliation.
We hope this post answered your question and you found this useful.
Cheers!
--------------------------------------------------------------------------------------------------------------------------

See Also
Recent Topics
Simplified Call Logging
Our organization would like to start logging calls in our CRM; however, with 13 fields that can't be removed, our team is finding it extremely cumbersome. For our use case, we only need to record that a call happened theirfor would only need the following
Help Center IFrame Issue
I have had a working Help Center on my website using an iframe for a while. But now for some reason the sign in page gets a refused to connect error. Can someone please help. If I go to the url manually it works correclty
Staff rules
Hi! Do you people know what are the default staff rules when a new booking is created? We have two staff members in my team (me as the admin, and my employee). As we share the same services, I'm wondering how Zoho will pick the staff for new apointments.
Comment Templates
Is it possible to add a template option for comments? We have some agents in the process who's responses require a pre-formatted layout. It would be incredibly handy to have a template for them where they can insert the template and then add their responses
[ZohoDesk] Improve Status View with a new editeble kanban view
A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
Adding Markdown text using Zoho Desk API into the Knowledge Base
Hi Zoho Community members, We currently maintain the documentation of out company in its website. This documentation is written in markdown text format and we would like to add it in Zoho Knowledge Base. Do you know if there is REST API functionality
An Exclusive Session for Zoho Desk Users: AI in Zoho Desk
A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
Shared values: From classroom lessons to teaching moments in customer service
While the world observes Teachers’ Day on October 5, in India, we celebrate a month earlier, on September 5, to mark the birth anniversary of Dr. Sarvepalli Radhakrishnan, a great teacher, renowned scholar, educationist, and advocate for empowerment.
Export to excel stored amounts as text instead of numbers or accounting
Good Afternoon, We have a quarterly billing report that we generate from our Requests. It exports to excel. However if we need to add a formula (something as simple as a sum of the column), it doesn't read the dollar amounts because the export stores
Auto Capitalize First Letter of Words
Hi I am completely new to ZOHO and am trying to build a database. How can i make it when a address is entered into a form field like this: main st it automatically changes is to show: Main St Thank You
Follow-up emails via Workflow Automation not staying in the same thread
Dear Zoho Support Team, I am currently using Workflow Automation in Zoho Campaigns to send follow-up emails. In my test case, I noticed the following behavior: All emails in the automation have the same subject line. If the follow-up email is sent within
Update application by uploading an updated DS file
Is it possible? I have been working with AI on my desktop improving my application, and I have to keep copy pasting stuff... Would it be possible to import the DS file on top of an existing application to update the app accordingly?
Send / Send & Close keyboard shortcuts
Hello! My team is so close to using Zoho Desk with just the keyboard. Keyboard shortcuts really help us to be more efficient -- saving a second or two over thousands of tickets adds up quickly. It seems like the keyboard shortcuts in Desk are only for
Image Upload Field | Zoho Canvas
I'm working on making a custom view for one of our team's modules. It's an image upload field (Placement Photo) that would allow our sales reps to upload a picture of the house their working on. However, I don't see that field as a opinion when building
Create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM
How to create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM? I was able to do a view in CRM based on customer that registered to an event, but I don't seems to be able to include the filter
Custom Button Disappearing in mobile view | Zoho CRM Canvas
I'm working in Zoho CRM Canvas to create a custom view for our sales team. One of the features I'm adding is a custom button that opens the leads address in another tab. I've had no issue with this in the desktop view, but in the mobile view the button
Zoho Desk blank page
1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
Clearing Fields using MACROS?
How would I go about clearing a follow-up field date from my deals? Currently I cannot set the new value as an empty box.
I hate the new user UI with the bar on the left
How can I reverse this?
Office 365 and CRM mail integration: permission required
Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
Field Not Updating in FSM Script - Service and Parts module.
Dear Team, I am reaching out regarding a script I have implemented in Zoho FSM to automate the calculation of the End of Service date based on the End of Sale date in the Service and Parts module. Overview of the script: Fetches the End_of_Sale__C and
Question regarding import of previous deals...
Good afternoon, I'm working on importing some older deal records from an external sheet into the CRM; however, when I manually click "Add New Deal" and enter the pertinent information, the deal isn't appearing when I look at the "Deals" bar on the account's
Client Script also planned for Zoho Desk?
Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
One person/cell phone to manage multiple accounts
Hi. I have a personal Free account to keep my own domain/emails. Now I need to create a Business account to my company's own domain, but I have only one mobile phone number I use to everything. How do I do to manage this? Can I manage a Free domain and
Tracking KPIs, Goals etc in People
How are Zoho People users tracking employee targets in People? For example, my marketing assistant has a target of "Collect 10 new customer testimonials every month". I want to record attainment for this target on a monthly basis, then add it to their
Zoho Desk: Ticket Owner Agents vs Teams
Hi Zoho, We would like to explore the possibility of hiding the ‘Agents’ section within the Ticket Owner dropdown, so that we can fully utilise the ‘Teams’ dropdown when assigning tickets. This request comes from the fact that only certain agents and
CRM limit reached: only 2 subforms can be created
we recently stumbled upon a limit of 2 subforms per module. while we found a workaround on this occasion, only 2 subforms can be quite limiting in an enterprise setting. @Ishwarya SG I've read about imminent increase of other components (e.
Can not Use Attachment Button on Android Widget
this always pops up when I touch the attach button on android widget. going to settings, there is no storage permission to be enabled. if I open the app, and access the attach feature there, I can access my storage and upload normally.
How do I filter contacts by account parameters?
Need to filter a contact view according to account parameter, eg account type. Without this filter users are overwhelmed with irrelevant contacts. Workaround is to create a custom 'Contact Type' field but this unbearable duplicity as the information already
Can I add Conditional merge tags on my Templates?
Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
Zoho Notebook Sync problem
I'm facing a problem with syncing of notebook on android app. It's not syncing. Sometimes it syncs after a day or two. I created some notes on web notebook but it's not syncing on mobile app. Please help!!!!
Kaizen #190 - Queries in Custom Related Lists
Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss yet another interesting enhancement to Queries. As you all know, Queries allow you to dynamically retrieve data from CRM as well as third-party services directly within
Custom Fonts in Zoho CRM Template Builder
Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
Announcing new features in Trident for Mac (1.24.0)
Hello everyone! Trident for macOS (v.1.24.0) is here with interesting features and thoughtful enhancements to redefine the way you plan and manage your calendar events. Here's a quick look at what's new. Create calendar events from emails. In addition
Need Easy Way to Update Item Prices in Bulk
Hello Everyone, In Zoho Books, updating selling prices is taking too much time. Right now we have to either edit items one by one or do Excel export/import. It will be very useful if Zoho gives a simple option to: Select multiple items and update prices
Vendor Master Enhancements for Faster Purchase Entry
I’d like to suggest a few features that will improve accuracy and speed during purchase voucher entry: Automated Item Tax Preference in Vendor Master Add an option to define item tax preference in the vendor master. Once set, this preference should automatically
Mass Mail Statistics - Number of unsent emails
How do I find out which emails were not sent?
Button to add product to cart
Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
Est-il possible d'annuler l'envoi d'un mail automatique ?
Bonjour, Lorsque je refuse un candidat, il reçois un mail dans les 24h pour l'informer que sa candidature n'est pas retenue. J'ai rejeté un candidat par erreur. Savez-vous s'il possible d'annuler l'envoi de ce mail ? Merci d'avance pour votre aide.
Is it possible to hide fields in a Subform?
Since layout rules cannot be used with Subforms, is there another way, or is it even possible, to hide fields in a subform based on a picklist fields within said subform? For example, if the Service Provided is Internet, then I do not want to see the
Next Page