Using ZRC in Client Script

Using ZRC in Client Script

Hello everyone!

Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. 

In this Kaizen post,

  1. What is ZRC?
  2.  ZRC Methods
  3. Use Case
  4. Solution
  5. Summary
  6. Related Links

1. What is ZRC?

Zoho Request Client (ZRC) is a built-in SDK in Zoho CRM that provides a unified way to make REST API calls across developer-centric features of Zoho CRM like Client Script, Widgets. Invoking CRM APIs, Connection APIs, and external APIs requires different syntax and separate code for each type. ZRC removes this complexity by offering one common and consistent approach to call all APIs, making client-side development easier and faster.

The following are the key features of ZRC.
  1. ZRC works with any CRM API version
  2. It supports self domain calls by providing only the API endpoint without specifying the domain
  3. Uses a single unified syntax for CRM APIs, custom Connections, and external public APIs. 
  4. No authentication handling needed for the same CRM org as ZRC manages it automatically
  5. Automatic JSON handling without manual parsing.
  6. Supports clean async code with full async-await and promise chaining.

2. ZRC Methods



Click here for more details about ZRC Methods.

3. Use Case - Log call notes and update the Lead status with a button click.

Quote
At Zylker, Salespersons often make multiple call attempts before connecting with a lead. Manually recording these attempts and updating the Lead status is often overlooked, leading to incomplete tracking and inaccurate pipeline data. To address this, the Admin wants the following changes:

1. Display a popup to capture call attempt details when a button is clicked and save them as a Note on the current Lead.

2. Also, update the Lead_Status of the current Lead to “Contacted” .

4. Solution

Here, the requirement is to create a note based on the Salesperson's description and update the status of the Lead record.To achieve this, Salesperson's input is collected through a pop-up when a custom button is clicked. The ZRC POST method is used to create a note for the Lead. The ZRC PUT method is used to update the status of the Lead record. As the Client Script has to be triggered with a button click, you should create a custom button and add Client Script from "Create Custom Button" pop-up.

  1. Go to Setup > Customization > Modules and Fields. Click Leads and navigate to "Buttons" tab.
  2. Specify the details about the custom button, Define action as "Client Script" and click Create.


  1. This opens Client Script IDE.
  2. Enter the following script and click Add in Client Script IDE. 
  1. // Validate if the script is running on a Lead record page
  2. if (!leadModule || !leadRecordId || leadModule !== 'Leads') {
  3.     ZDK.Client.showMessage('This script is designed to run exclusively on Lead record pages. Please navigate to a Lead record to use this feature.', { type: 'warning' });
  4.     return;
  5. }

  6. // Display a loader to indicate ongoing background operations
  7. ZDK.Client.showLoader({ message: 'Logging call attempt and creating follow-up actions...' });

  8. try {
  9.     // 1. Create a standardized Note attached to the Lead
  10.     var notes_content = ZDK.Client.getInput([{
  11.         type: 'text',
  12.         label: 'Log Call Details'
  13.     },
  14.     ], 'Log Call Details', 'OK', 'Cancel');
  15.     log(notes_content);
  16.     console.log({ notes_content });
  17.     const notePayload = {
  18.         data: [{
  19.             Note_Title: 'Call Attempt Log',
  20.             Note_Content: notes_content[0],
  21.             Parent_Id: { // Associate the note with the current Lead record
  22.                 id: leadRecordId,
  23.                 name: leadRecordName,
  24.                 module: {
  25.                     api_name: leadModule
  26.                 }
  27.             }
  28.         }]
  29.     };

  30.     const noteCreationResponse = await zrc.post('/crm/v8/Notes', notePayload);

  31.     // Check for successful note creation (200 OK or 201 Created)
  32.     if (noteCreationResponse.status !== 201 && noteCreationResponse.status !== 200) {
  33.         throw new Error('Failed to create Note: ' + JSON.stringify(noteCreationResponse.data));
  34.     }

  35.     // 2. Update the Lead_Status field to “Contacted” on the current Lead
  36.     const leadUpdatePayload = {
  37.         data: [{
  38.             id: $Page.record_id, // Specify the record to update
  39.             Status: 'Contacted'
  40.         }]
  41.     };
  42.     const leadUpdateResponse = await zrc.put(`/crm/v8/${leadModule}/${leadRecordId}`, leadUpdatePayload);
  43.     $Client.refresh();

  44.     // Check for successful lead status update (200 OK or 202 Accepted)
  45.     if (leadUpdateResponse.status !== 200 && leadUpdateResponse.status !== 202) {
  46.         throw new Error('Failed to update Lead Status: ' + JSON.stringify(leadUpdateResponse.data));
  47.     }

  48.     // Display a success message
  49.     ZDK.Client.showMessage('Call attempt logged, and Lead status updated', { type: 'success' });

  50. } catch (error) {
  51.     // Log and display an error message if any step fails
  52.     console.error('Error executing Log Call Attempt script:', error);
  53.     ZDK.Client.showMessage(`An error occurred: ${error.message}`, { type: 'error' });
  54. } finally {
  55.     // Always hide the loader, regardless of success or failure
  56.     ZDK.Client.hideLoader();
  57. }

  1. In the above script, $Page.module retrieves the current CRM module from which the script is executed.
  2. $Page.record_id fetches the unique ID of the record currently opened on the page.
  3. $Page.record provides access to the field values of the current record.
  4. ZDK.Client.showLoader() displays a visual loading message to inform the Salesperson that background operations are in progress.
  5. ZDK.Client.getInput() prompts the Salesperson to enter details about the call through an input dialog.
  6. ZRC.post() sends a POST request to Zoho CRM to create a new record and automatically handles authentication and domain resolution.
  7. In the notePayload,"Parent_Id" links the created note to the current CRM record and module.
  8. ZRC.put() sends a PUT request to Zoho CRM to update an existing record.
  9. $Client.refresh() refreshes the current CRM page so the latest updates are immediately visible to the Salesperson.
  10. Here is how Client Script works.




5. Summary

1. How to update a record in Zoho CRM using ZRC 
2. How to insert a record using ZRC




      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Kaizen #198: Using Client Script for Custom Validation in Blueprint

            Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
          • Kaizen #226: Using ZRC in Client Script

            Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
          • Kaizen #222 - Client Script Support for Notes Related List

            Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
          • Kaizen #217 - Actions APIs : Tasks

            Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
          • Kaizen #216 - Actions APIs : Email Notifications

            Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • First Response Time, Where to find?

                                    Hi Currently I'm building a feeder file that auto-fetch ticket details when created/updated. On my table headers, apart from custom fields, I'm specifically looking for First response time. Currently I'm checking capabilities using Zoho Flow but couldn't
                                  • Zoho Books | Product updates | May 2026

                                    Hello users, We're back with the latest updates and enhancements we've rolled out in Zoho Books. From sales tax automation to scanning receipts for free, explore the updates designed to upgrade your bookkeeping experience. Sales Tax Automation [US & Canada
                                  • Cliq iOS can't see shared screen

                                    Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                  • No Ability to Rename Record Template PDFs in SendMail Task

                                    As highlighted previously in this post, we still have to deal with the limitation of not being able to rename a record template when sent as a PDF using the SendMail Task. This creates unnecessary complexity for what should be a simple operation, and
                                  • Undelivered Mail uncategorized-bounce errors when sending invoices

                                    Recently we have been getting Undelivered Mail bounce notification when sending invoices. Reason: uncategorized-bounce Some go through no problem some bounce back. We recently sent 10 invoices, 6 received bounce notifications. After reaching out to the
                                  • Ability to Edit the "Current Job Title" dropdown field

                                    Current experience/Issue: When a user (candidate) uploads resume to Zoho Recruit candidate portal, some fields are prefilled with the info from the resume/cv correctly. However, we've observed that; 1. the "Current Job Title" dropdown field is usually
                                  • Zoho Customer Grievance Escalations Matrix

                                    We have been with Zoho for little over a 24 months having several licenses for Zoho One and with standalone license for Zoho Commerce Advanced Plan along with their so called "Premium Support" for which they charge you a pretty hefty amount. It's been
                                  • Switch between multiple LLMs instantly for tailored Zia experiences

                                    Availability Editions: Professional , Enterprise, Ultimate , CRMPlus , ZohoOne Release Plan: Available for all DCs Hello everyone. Earlier, the Multi-LLM feature supported only one LLM at a time for Zia Record Assistant bot restricting flexibility from
                                  • Data entry and automatic barcode sticker printing

                                    Hello there I am very new to Zoho.. and not sure if it can do, or should I say, I can easily set it up to do, or first basic requirement. We take in up to 1000 unique used products every week. They come from up to 50 regular suppliers. The are used household appliances. We try to fix most of them. For waste regulation purposes we have to track every machine from the source/supplier it cam from to if it was repaired and put back on the market? or stripped and scrap for material recovery. Is it possible
                                  • Inventory Barcode Creation - Add Picture of Item

                                    Hi I am trying to set up bar code labels and include a picture of the item on the label - any idea on how to add that field to the barcode generator?
                                  • Setting up a barcode system with Zoho Creator

                                    Hello! I am researching how to set up a barcode inventory system that is compatible with Zoho Creator. I am working with an art inventory, and I want to be able to refer to each piece of artwork with a barcode. My goal is to be able to generate a barcode, store that barcode in a Zoho Creator database, be able to print out a barcode label from that database, and have the database pull up a record when the barcode associated with that record is scanned. I understand that there are barcode generating
                                  • New Built In QR/Barcode Generator Print Settings

                                    I'm trying out the new QR/Barcode generator field in Creator. I would think most people will want to print these, like I do. I am not seeing any way to control the height or width of the barcode for printing (inside the print/pdf template builder). The
                                  • Inventory SKU barcode printing

                                    Hi I am a developer and am wondering if zoho creator or even zoho inventory have the capability to print barcodes upon submitting a form. I have been researching the forums and have not been able to find any way to do this natively in Zoho. Can someone
                                  • PRODUCT LABEL MUST HAVE MORE FIELDS AND OPTIONS - VOTE NOW!

                                    The Zoho Inventory Product Barcode generator is unfinished, very limited, and unusable for most companies that need to generate informative product labels. Companies must be able to generate labels for products they receive to control inventory, so the
                                  • Ability to "Add Additional Guest" to Bookings

                                    When using other calendar booking services such as Calendly, there is an option to "Add Additional Guest" to a booking. For example, imagine User A is making a booking on my company's booking calendar and would like to invite their spouse (User B) to
                                  • Modify logo on exported PDF article

                                    Hello, I have to 2 Help Center with 2 different brands. If I try to download an article from Help Center Brand #2 as a PDF file, I see the Brand #1 logo on it. Is there a way to modify or hide the logo in the pdf? Thank you Antonio
                                  • Get Files Associated to Data Template via API

                                    I have a data template with multiple files associated to it, and trying to write a Deluge script that will fetch files associated with this data template. I created the script below based on the WorkDrive API documentation, one request uses the data templates
                                  • Pasting Images in Zoho Desk ignores cursor location

                                    My team has reported an issue which started recently where when we paste an image into a new or existing reply or comment, the pasted image seems to ignore the current cursor location instead paste itself at the last character present in the reply/comment,
                                  • Push conversation to operator in guided conversations

                                    I really would like to push the conversation to an operator from a specific deppartment in guided conversations, just like Zobot in sales iq. It would help a lot. For me it does not make sense to use sales iq for messenger, instagram and others, because
                                  • Lost the ability to sort by ticket owner

                                    Hi all, in the last week or so, we have lost the ability to sort tickets by Ticket Owner. Unlike the other columns which we can hover over and click on to sort, Ticket Owner is no longer clickable. Is it just us, or are other customers seeing this too?
                                  • Zero Customer Support

                                    I have been a paying customer on Zoho Mail Premium, which clearly advertises a 40MB attachment limit. However, for a long time now, I have been experiencing ongoing issues sending PDF attachments over 10MB. Instead of sending properly as attachments,
                                  • Unable to send message;Reason:554 5.1.8

                                    Dear Zoho Support Team, I have attempted to send multiple documents in several different ZIP files containing PDF and Word documents. Initially, I received the following notification: “When Office 365 tried to send your message, the receiving email server
                                  • SOLVED - Unsubscribe Feedback Page inexplicably presenting in French, German, etc. not default language of English

                                    As the titles says, had the "Unsubscribe Feedback Page" for two different clients presenting the feedback options to unsubscribers in French, German, etc., not in English like it should. And no, it wasn't due to user preferences, embedded web translators,
                                  • Identify and clean hard bounce lists in Automation 2.0

                                    Hello. 1. I want to know how I can identify hard bounces in the lists I created to clean them before sending an email, given that the bounce rate has increased and it is necessary to clean the lists. 2. How can I exclude hard bounces and invalid emails
                                  • Catalyst DB is insufficient for many use cases

                                    Hi all: I've been diving deep on full stack application development inside Zoho Catalyst. I've been using catalyst for serverless compute and API gateway for a few years, but I haven't used the DB beyond simple storing of app data. As I was working through
                                  • Edit a previous reconciliation

                                    I realized that during my March bank reconciliation, I chose the wrong check to reconcile (they were for the same amount on the same date, I just chose the wrong check to reconcile). So now, the incorrect check is showing as un-reconciled. Is there any way I can edit a previous reconciliation (this is 7 months ago) so I can adjust the check that was reconciled? The amounts are exactly the same and it won't change my ending balance.
                                  • Can I use 24 hour time format in Zoho Social

                                    Can I use 24 hour time format in Zoho Social? AM/PM is annoying, backwards – and leads to errors in posting time…
                                  • Transfer Ownership of Documents

                                    In an organization, a person moves from one team to another or decides to leave his / her current post. He may have files / folders that are important and confidential, and needs to be transferred to another member in the organization. Zoho Docs lets you Transfer Ownership of document / folder from one member to another in a few clicks. This action has to be performed by the administrator. Just follow these simple steps to transfer the ownership of your documents / folders: In the top right corner
                                  • How to change column headings in pivot table?

                                    Hi, Is there a way to rename the column headers of a pivot table? Now some the columns are named with value labels: 'SUM of .....'. We would like to rename those headers. As of now we couldn't find any direct solution to adjust the headers, besides copying and reformat. We want to avoid these extra steps. Best, Tiemen
                                  • Native QuickBooks integration for Zoho CRM: Connecting sales and finance

                                    Greetings, I hope all of you are doing well. We're excited to announce Zoho CRM's integration with QuickBooks Web, which is designed to synchronize your CRM data with your QuickBooks accounting records and bridge the gap between sales and finance. This
                                  • Rename system-defined labels in Zoho CRM

                                    Renaming system-defined labels is now available across all DCs. Hello everyone, Zoho CRM includes predefined system fields across modules to support essential CRM operations. Until now, the labels of these fields were fixed and could not be edited from
                                  • Report/All Entries Filter Contains to support multiple values

                                    Hi, I use different fields to filter All Entries before Export, one is the Added Email ID (May soon replace with the new Logged in User Name Field!!), and I want to filter for more than one person, so select "Contains", but I try with a comma seperating
                                  • Marketing Tip #32: Improve SEO and customer confidence with an FAQ section

                                    Before making a purchase, customers often have simple questions about delivery times, returns, product usage, or sizing. If they can’t quickly find answers, they may leave your store without buying. Adding a clear FAQ (Frequently Asked Questions) section
                                  • Zobot with Plugs

                                    Hello, I am having a problem with Zobot using Plugs. Here is my current flow: When I run the flow, I should immediately see the messages from the initial cards (Send Message cards), then after running the plug, and finally, see the messages after the
                                  • Zoho Creator é para você? Saiba quando escolher (e quando não escolher) essa plataforma

                                    Todo mês alguém me pergunta: "Leandro, vale a pena usar o Zoho Creator para o meu projeto?" A resposta honesta é: depende. E neste artigo vou te dar os critérios reais que uso para tomar essa decisão — sem marketing, sem generalização. O que é Zoho Creator,
                                  • Control Fields on Mobile App

                                    On the mobile app, how do we control which fields appear on the screen for records that have a related list? In the example below I want the Inspection Stage and Inspection Type fields to appear, not the record owner (Dev Admin). I changed the Inspections
                                  • Show Zoho Marketing Automation Messages in SalesIQ Chat

                                    When the same number is used in Zoho Marketing Automation and SalesIQ, campaign messages should be visible inside the SalesIQ chat. Currently, when customers reply to marketing campaign messages, SalesIQ chat owners get confused because they cannot see
                                  • SalesIQ Chat Owner to CRM Lead Owner Mapping

                                    There is no proper mapping between the SalesIQ chat owner and the CRM lead owner. When a chat is assigned to an agent, the lead created in CRM is often assigned to a different user, forcing admins to manually change ownership every time. This creates
                                  • Automatic Email Alerts for Errors in Zoho Creator Logs

                                    Hello, We would like to request a feature enhancement in Zoho Creator regarding error notifications. Currently, Zoho Creator allows users to view logs and errors for each application by navigating to Zoho Creator > Operations > Logs. However, there is
                                  • [Webinar] Agentic AI and its influence on analytics and autonomous decision-making

                                    Analytics is evolving from passive reporting to proactive, intelligent systems. Agentic AI is at the center of this shift, bringing context-aware reasoning, continuous learning, and the ability to act on data in real time. Join this webinar with Michael
                                  • Next Page