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
Average Costing / Weighted Average Costing
Hello fellow maadirs. I understand Zoho Books uses FIFO method of dealing with inventory costing, but do you guys have any plans to introduce average costing? We indians need average costing. It's part of our culture. Please. I beg thee. Thanks.
SMS to customers from within Bigin
Hi All, Is there anyone else crying out for Bigin SMS capability to send an SMS to customers directly from the Bigin interface? We have inbuilt telephony already with call recordings which works well. What's lacking is the ability to send and receive
How to update/remove file in zoho creator widgets using javascript API
Hi Team, I have developed a widget which allows inserting and updating records I have file upload field with multiple file upload. Now while doing insert form record, I am using uploadFile API to upload files for that record. I am using updateRecord API
Parent & Member Accounts (batch updating / inheritance)
Hello, I find the Parent Account functionality very useful for creating custom views and reports, but was wondering if I can also carry out batch editing on all members (aka children) of a Parent Account at the same time. Alternatively, can I set members to automatically inherit the values of the parent? For example: We have a chain of supermarkets that buy our products. These supermarkets are all members of a Parent Account in our CRM. We release a new product and all of the member stores wish to
Edit Legend of Chart
I would like to edit the legend of the chart. Every time I enable the legend, I get a very unhelpful (1), and when I try to type to change to what I would desire, nothing happens, which is very frustrating. I've gone through your online tutorials and nowhere can I find a legend settings button. This seems a simple fix, where can edit the legend? Thanks.
Extended timeouts for APIs beyond 40secs for to accomodate LLMs
A 40 second max response time for API calls is fine when connecting to most services, however is unsuitable when dealing with LLMs (ChatGPT/Claude/Gemini) where the response timing is very uncertain. Is there any way to increase this? It would be great
Deletion of Zoho Account
To whom it may concern, Good day, My account has been created incorrectly in Zoho and I am not able to join my Company's Zoho account - attached screenshot for your kind reference Alphatronmarine - Portal Kindly advise procedure to delete this current
Workflow for deposit to bank account
Hello, Is it possible to make a workflow when a deposit is made to your bank account which is coupled to Zoho books? I want Zoho to sent an email each time a deposit is made to our bank account via a workflow. Regards, Steven
Marking Retainer invoice paid through Deluge
Hey Everyone, We have a scenario where we are collecting deposit payments on our website. Now, in zoho books, we need to create a retainer invoice and mark it as paid automatically using deluge just like we can mark normal invoices as paid. I have tried
Export Invoices to XML file
Namaste! ZOHO suite of Apps is awesome and we as Partner, would like to use and implement the app´s from the Financial suite like ZOHO Invoice, but, in Portugal, we can only use certified Invoice Software and for this reason, we need to develop/customize on top of ZOHO Invoice to create an XML file with specific information and after this, go to the government and certified the software. As soon as we have for example, ZOHO CRM integrated with ZOHO Invoice up and running, our business opportunities
Create a new record in custom module vi custom button
I have zoho books premium plan . I have 2 custom modules in zoho books. 1. Goods Receipt 2. Delivery Order, I need to select multiple records from Goods Receipt and create a new Delivery order from these multiple records. (like multilple sales order into
Profile date settings
At present I have "EEE, MMMM dd, yyyy" but this takes an exessive amount of column space, we should be able to input our own format. I would like to use "EEE, MMM dd, yy" - a much shorter version of the above but with the same abbreviated info, requiring
Delivery Method Field in Sales Order Module
In Books and in Sales orders, the "Delivery Method" field seems to allow for anything to be entered and it seems to store those entries for future use. When you chose to convert a sales order to a purchase order, the related field is now called "Shipment
Editing / Removing stages for pipeline
Hello, I'm trying to create a new pipeline. I created a new stage and made an error when entering the probability. How can I edit fields in stages that I created? Can I delete these stages from "Add Stages" list?
Dynamically Filter User Lookup in CRM Subform
We have a subform called Pricing Calculator in the Zoho CRM Opportunity module and need some assistance. Current Setup: First column: Picklist (Level) Second column: User Lookup field When a Level is selected, we want the User lookup to display only users
change time zone
can't seem to figure out how to change the time zone of the project
Bigin iOS app update: Built-in telephony and RingCentral support
Hello everyone! We are excited to introduce Built-In Telephony and RingCentral support in the latest iOS version(v1.11.13) of the Bigin mobile app. Once the integration is completed on the Bigin desktop site(bigin.zoho.com), you can choose the Built-In
Add Image or Update Image API - for Items Module
I am trying to add new Items to Zoho Inventory from Zoho Creator. I achieved this using Zoho Inventory Create Item API, but how to add or update the item image from Zoho Creator to Zoho Inventory Item Module?
Introducing Booking Pages—a topping for your Calendar Scheduling needs!
Greetings, We're here with a new topping for Bigin! Let's dive into the details. What does this topping do? Scheduling appointments with customers is one of the most common challenges small businesses face on a daily basis, as it often involves frequent
Debugging `try` blocks : Tip
I find it annoying that if one line inside a `try` block has an error, the Deluge arser points the beginning of the block to the location of the error. BUT, if you temporarily comment out the initial `try {`  The parser goes through the whole block and
[Product Update] TimeSheets module is now renamed as Time Logs in Zoho Projects.
Dear Zoho Analytics customers, As part of the ongoing enhancements in Zoho Projects, the Timesheets module has been renamed to Time Logs. However, the module name will continue to be displayed as Timesheets in Zoho Analytics until the relevant APIs are
Use approval workflow comments in record scripts
Greetings, i'm running an approval workflow for my records, during approval/rejection there is a step where comments are entered. i want to add there comments to the record and to use them in various deluge scripts like sending emails and so on. how
ZOHO Store
Not able to make a payment We are using Zoho One, and we are from India. The payment currency, which shows for us, is in USD. But the system says we can choose Country/Region India if it shows INR only. Attaching screenshots for more info.
Support Migration into Aliases in Zoho Mail
Hello Zoho Mail Team, How are you? We are in the process of migrating some of our users from Google Workspace (Gmail and Google Drive) to Zoho. During this process, we noticed that Zoho Mail currently only supports migration into a primary mailbox and
API for Z Workdrive Flow Make-Integromat ?
We are zoho workdrive fans Also we would like to have an api to work with Zoho Flow or with Make better known by its old name INTEGROMAT Is it planned and when? 3 months -6 months or more?
Apps Pane no longer visible
I have read all the info and help and nothing works, I do not have a "show apps" anywhere and I can no longer see my Apps pane in the left hand side of mail, please advise how to get this back
Canvas View - Print
What is the best way to accomplish a print to PDF of the canvas view?
5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(8/21)
ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 8月開催のZoho ワークアウトについてお知らせします。 今回はZoomにてオンライン開催します。 ▷▷参加登録はこちら:https://us02web.zoom.us/meeting/register/eVOEnBsSQ2uvX4WN5Z5DeQ ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho
New in Zoho Forms: Inline OTP Verification
Hello form builders, We are excited to announce the launch of Inline OTP Verification in Zoho Forms, a smarter way to ensure the authenticity of the contact details you collect. Until now, OTP Verification in Zoho Forms worked as a pre-access step: respondents
Zoho Mail : Associate emails with Meeting records and allow multiple emails to be assocaited at once
Is there a workaround that would allow either of these? I want to associate emails with Meeting records. I also would like to be able to select multiple emails at once for association with a record.
Create task from email
Is there a way on mobile to create a task from an email? I use this feature a lot and when traveling now I read email on mobile. By the time I get to my office I forget about them since I didn't add it to a task. Is this feature missing on moble?
Zoho Socials - Unable to view Channels and SmartQ
Hi, The channel Facebook has been added by the admin, however, it is not visible on the User level (employee). Other channels are visible. Also, we have the premium account, and SmartQ is not working. Can anyone help? Regards, Priyanka
Eliminating Manual Consolidation: Automating Currency Field Sync from Task to Project
Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
We want to set the "Converted from Lead" value in Deals using a Workflow or via a Deluge script. How?
For use in Zoho Analytics, we need the field "Converted from Lead" filled in our deal records. This field is empty everywhere, because we do not create deals directly when converting a lead to a contact. We want to do that using the API or a workflow
Sales Orders: Quoted_Items + items in another subform -> into Ordered_Items ?
hello, When creating Sales Orders, is it posible to inherit/fill the Ordered_Items with all the items from Quoted_Items + all the items from a customized subform with similar fields? Since you can create a sales order in different ways (convert, new -
How to cancel the GSTR1 pushed to GSTN
How to cancel the GSTR1 Pushed to GSTN, some rectifications to be done in HSN & SAC code
Zoho Books API — Invalid Operation Type / Scope does not exist
Hello Team, We are unable to use the Zoho Books API from our registered application. We’ve already: Created a client in Zoho API Console using (Admin in Books) Generated the OAuth code and token successfully Used the correct scopes: ZohoBooks.fullaccess,ZohoOauth.userinfo.READ
Enhancements in Canvas
Dear All, Greetings! Canvas lets you design the record details page to suit your brand or business preferences. We are glad to introduce the following enhancements to uplift your design experience. Reusable Components Style Presets Let's go! Reusable
Minimum order quantity
Is there a way to enforce a minimum order quantity - ie has to have a minimum of 250?
【Zoho CRM】ポータル機能のアップデート:UIとポータルの作成フローの変更
ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中から、ポータル機能のアップデートをご紹介します。 目次 概要 ユーザーグループの作成フローの変更 ユーザーグループ詳細画面内のタブについて 「タブと権限」タブについて 「設定」タブについて 概要 UIとポータルの作成フローが変更されました。ポータルの新機能に先立ち、UIを一部変更しました。タブやオプションの配置を見直し、機能へよりアクセスしやすくなっています。 また、「ポータルユーザーの種類」は今後、「ユーザーグループ」と呼称され、ページ上のボタンも「ユーザーグループを作成する」に変更されます。
Next Page