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
Unified customer portal login
As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
WhatsApp Channels in Zoho Campaigns
Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
error : Object code : 6500
b3 = map(); b3.put("name", "Test Project Name"); updateprojects2 = invokeurl [ url :"https://projectsapi.zoho.eu/restapi/portal/era0130/projects/169495000000928007/" type :PUT parameters: b3 connection:"in2" ]; info b3 ; info updateprojects2; ------------
I got unknown charge from Zoho
Good day, I need help disputing a charge I don't know from, zoho. I have ZohoMail and ZeptoMail. I purchase credits for ZeptoMail, and for ZohoMail I am not subcribed.
How can I see content of system generated mails from zBooks?
System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
Zadarma + Zoho CRM Integration – Missed Calls Saved as Contacts Instead of Leads
Hello everyone, I’m looking for input from anyone with experience using the Zadarma + Zoho CRM integration. Currently, I’m seeing that missed calls are automatically being created as Contacts instead of Leads. From a CRM perspective, this doesn’t make
Function 56: Automatically enable the option for customers to pay via bank account
Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
Attach Files to Your Notecards and share them on the go!
Hey everyone! We’re excited to share a feature many of you have been asking for — you can now attach files directly to your text notecards and share with ease! 🙌 This update was built with your feedback in mind, especially for those who wanted a simple
Can i connect 2 instagram accounts to 1 brand?
Can i connect 2 instagram accounts to 1 brand? Or Do i need to create 2 brands for that? also under what subscription package will this apply?
Workdrive on Android - Gallery Photo Backups
Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
Integración Books para cumplir la ley Crea y Crece y Ley Antifraude (VeriFactu)
Hola: En principio, en julio de 2025, entra en vigor la ley Crea y Crece y Ley Antifraude (VeriFactu). ¿Sabéis si Zoho va a cumplir con la ley para cumplir con la facturación electrónica conectada a Hacienda? Gracias
YouTube Live #1: AI-powered agreement management with Zia and Zoho Sign
Hi there! We're excited to announce Zoho Sign’s first YouTube live series, where you can catch the latest updates and interact with our Zoho Sign experts, pose questions, and discover lesser-known features. We're starting off by riding the AI wave in
How to add a % Growth column for year-over-year comparison (2024 vs 2025)
Hello, I am trying to build a monthly revenue comparison between 2024 and 2025 in Zoho CRM Analytics. My current setup is: Module: Deals (Affaires) Filter: Stage = Closed Won Date field: Closing Date Grouping: By Month Metrics: Sum of Amount for 2024,
How to searchByCriteria records that are under approval?
I need to search for both approved and pending approval records Is that possible with this method? Or I need to a different method? var priceReqID = $Page.record_id; log(priceReqID); var records = ZDK.Apps.CRM.Price_List_Item.searchByCriteria("Price_Request:equals:"
Power of Automation::Streamline log hours to work hours upon task completion.
Hello Everyone, A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
How to add Simple Analytics to Zoho Pages?
I have a website with Zoho Pages, how do I add Simple Analytics on it? They seem to have code they need to be embedded https://docs.simpleanalytics.com/script
End Date in Zoho Bookings
When I give my appointments a 30 minutes time I would expect the software not to even show the End Time. But it actually makes the user pick an End Time. Did I just miss a setting?
Cant seem to delete an email account
Hello, I have researching for 4 days how to delete an email account and I am absolutely without a clue. The email account I am trying to delete is support<AT>fyshoes<dot>com. It's the first email account I made and it (is???) was associated with the super user (me). I have since changed it to adming<AT>fychoes<dot>com and I see the support email in my list but I just cant seem to get rid of it. Ultimately I want to associate that email account with another user that I want to add. This is really
Commerce Order as Invoice instead of Sales Order?
I need a purchase made on my Commerce Site to result in an Invoice for services instead of a Sales Order that will be pushed to Books. My customers don't pay until I after I add some details to their transaction. Can I change the settings to make this
Import data into Multi-Select lookup field from CSV/Excel
How to import data into a multi-select lookup field from the CSV/Excel Sheet? Let's say I have an Accounts multi-select lookup field in the Deals module and I want to import the Deals with Accounts field. Steps:- 1. Create/edit a multi-select lookup field
Sync desktop folders instantly with WorkDrive TrueSync (Beta)
Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
Script that deletes a record?
We're using WP Plugin "Integration for WooCommerce and Zoho Pro", and have created a couple of Feeds to send data to Zoho. We are trying to create Contact records, but only based upon condition. Tried to make it with small Deluge function and Workflow,
A formula that capitalises the first letter of each word
Hi all, is there a zoho formula that can capitalise the first letter of each word in a string? INITCAP only capitalises the first letter of the first word.
Reverse payment on accidentally closed invoice.
An invoice was closed accidentally with the full payment added. However, only partial payment was paid. How can I reopen the invoice and reverse this to update it to show partial payment?
Quotes in Commerce?
In Zoho Ecommerce, I need to be able to generate quotes, negotiate with customers, and then generate invoices. Currently, I plan to integrate Zoho CRM to generate quotes. After negotiation and confirmation, I will push the details to Zoho Ecommerce to
Zoho Commerce - Mobile Application
Does Zoho Commerce have a mobile application for customers to place an order?
Register user through Phone Number by Generating OTP
In zoho commerce , I am developing website on online food store Inilialy the user get verification code to their email for registering there account for login. But I need to login using phone number by generating OTP automatically rather than verification
Custom Buttons for Mass Actions
Hello everyone, We’ve just made Custom Buttons in Zoho Recruit even more powerful! You can now create Bulk Action Buttons that let you perform actions on multiple records at once, directly from the List View. What’s new? Until now, custom buttons were
Zoho Vault Passwords
Is there a way to consume Zoho Vault Manager passwords using the API? Thanks in advance.
Is the ChatGPT Assistant integration capable of recognizing WhatsApp voice messages?
I was wondering: if a visitor sends me a voice message on WhatsApp, would the assistant be able to transcribe it and reply to them?
Zoho Creator to Zoho CRM Images
Right now, I am trying to setup a Notes form within Zoho Creator. This Notes will note the Note section under Accounts > Selected Account. Right now, I use Zoho Flow to push the notes and it works just fine, with text only. Images do not get sent (there
【Zoho CRM】レポート機能のアップデート
ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中から、レポート機能のアップデートをご紹介します。 目次 1. レポートのエクスポート時のレコードIDの表示について 2. 通貨項目の表示について 3. レポートの削除の監査ログへの反映について 1. レポートのエクスポート時のレコードIDの表示について これまで、レポートをエクスポートするとファイルにレコードIDが必ず含まれていました。レコードIDが識別子として役立つ場合もありますが、実際には多くの企業で参照されることはありません。
Translation in zoho bookings
We cant translate zoho booking emails. The general text we can change. But what about text like: ""Here a link to join the meeting online:"" and "Add to Zoho Calendar" and "Add to Google Calendar"? No professional business have mixed languages. Its looking
Is there any way to bill one client in different currencies on different invoices?
I have some customers who have their currency set as USD and most of their billing is done in USD. However, from time to time I have a need to bill them in my base currency GBP for some specific invoices, but there seems to be no way of doing this that I can see. The only workaround that I can see is to create two client records for the same client, one for USD billing and one for GBP billing, but this is not an ideal situation. Is it likely that the (hopefully!) soon to arrive multi-currency support
API name for all fields in Zoho Project (Standard or custom)
Hi! I struggle to find easily all API name of all field in Zoho Project to build my API rest with other services. We can find them very fast in CRM but not in PRoject. Could you share a function to get the list of all API Name of any field of an App
Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration
Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
Zoho Assist not rendering NinjaTrader chart properly
Hi everyone. Just installed and testing Zoho Assist. I want to display my laptop' screen (Windows 11) on a monitor connected to my Mac mini. The laptop is running a stock trading program called NinjaTrader. Basically, when running, this program displays
Involved account types are not applicable when create journals
{
"journal_date": "2016-01-31",
"reference_number": "20160131",
"notes": "SimplePay Payroll",
"line_items": [{
"account_id": "538624000000035003",
"description": "Net Pay",
"amount": 26690.09,
"debit_or_credit": "credit"
}, {
"account_id": "538624000000000403",
"description": "Gross",
"amount": 32000,
"debit_or_credit": "debit"
}, {
"account_id": "538624000000000427",
"description": "CPP",
"amount": 1295.64,
"debit_or_credit": "debit"
}, {
"account_id": "538624000000000376",
"description":
Adding Social Media Buttons to Basic Campaigns
Hi, I'm quote new to using Zoho Campaigns and I can't work out how to add Social Media Buttons into my basic campaign? In MailChimp there's a button that brings the icons into your campaign for you. I've tried adding the social media icons as 'buttons' in Zoho but it's not looking great. Can anyone help? Thanks!
Dropshipping Address - Does Not Show on Invoice Correctly
When a dropshipping address is used for a customer, the correct ship-to address does not seem to show on the Invoice. It shows correctly on the Sales Order, Shipment Order, and Package, just not the Invoice. This is a problem, because the company being
Next Page