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



    • 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
      • Recent Topics

      • Selecting all notes in a notebook

        In Windows11, I select a notebook and I get a list of notes, but only 30 notes. If I scroll down to the end, I get an additional 30 notes (and at the top it now shows 60 notes). I can keep doing this to eventually see all my notes but this is a real pain.
      • Update latitude & longitude address field API

        How do I update the coordinates of an address field from a widget? I can't modify the latitude and longitude of the address field. I think the problem is how I'm writing formdata variable. zoho_init.then(function (data) { var queryParams = ZOHO.CREATOR.UTIL.getQueryParams();
      • Filter Records in CRM API

        Hi Team, I’m currently working on a task to retrieve expired deals from the CRM. By “expired deals,” I mean deals where the closing date has already passed and the stage is not “Closed Won” or “Closed Lost” (i.e., all other stages). I tried using both
      • User Name in Zoho Cliq Not Updating Across Apps?

        We updated the name of a user in Zoho. (From Sue to Taylor) Her name has not been updated in Cliq on all apps. When in Zoho One, if I go to Cliq directly, it is correct, but if I am in another app, and the Cliq bar pops up on the bottom, it will be the
      • Ability to Use Both AND and OR When Creating Rules (Advanced Conditions)

        I'd like to be able to use more complicated logic when setting up rules. E.g. in Zoho Mail, I can choose "Advanced conditions (AND/OR) to create a rule that can be applied to multiple subject lines from the same sender. But in Zoho TeamInbox, I will have
      • Attaching files to emails within CRM Deals.

        Hello, We have recently started using the extension "Workdrive for CRM" (Related List) to view/store our documents for each Deal, instead of using Attachments. Overall it feels like a better way to go but the user experience is not so great when it comes
      • Why I can't map Account Name from lead module to Account module?

        When I qualify a lead in the bluerprint, I use automated conversion in Blueprint to automatically create Contact, Account and Deal. the Deal record and contact record has been successfully created automatically as I expect, but I can't see any account
      • Pause(1);

        I'm using scheduler to invoke an interaction via http post with an external service. The schedule code uses a for-each loop that runs so fast my external application's log files get messed-up (they are named by date-time stamp). What I'm suggesting is
      • Release Notes | February 2026

        We have rolled out another set of enhancements in Vertical Studio during February 2026, bringing improvements to Canvas customization, reporting capabilities, and data access controls. Here is a summary of what was released during February 2026: Canvas
      • Agentic Engineering with Zoho: The Next Evolution of Intelligent Systems

        The concept of Agentic Engineering is reshaping how modern systems are designed. It introduces a new layer to the way we think about artificial intelligence and system architecture. For years, most software systems have operated in a reactive way — responding
      • Engenharia Agêntica e as soluções da Zoho

        O conceito de engenharia agêntica impacta diretamente como os sistemas são projetos. Este tema inseri mais uma camada a nossa idéia de inteligência artificial. Antes o desenvolvimento de sistemas operavam de forma reativa e dependente de comandos diretos,
      • Beyond Task Lists #1 Effective project and task customization with CodeX

        Dear users, Beyond Task Lists is a series of articles aimed at showcasing the various customization capabilities of Zoho Projects. We'll discuss real life project management scenarios, use cases, and requirements that needs combining multiple features.
      • Is Zoho Sites still actively being developed?

        Hello, Is Zoho Sites still actively being developed as part of the Zoho ecosystem? I noticed that the What's New page (https://www.zoho.com/sites/whats-new.html) does not show any updates since Q1 2025. We were considering migrating our website from Squarespace
      • Set expiration date on document and send reminder

        We have many company documents( for example business registration), work VISA documents. It will be nice if we can set a expiry date and set reminders ( for example 90 days, 60 days, 30 days etc.,) Does Zoho workdrive provide that option?
      • Depositing funds to account

        Hello, I have been using Quickbooks for many years but am considering moving to Zoho Books so I am currently running through various workflows and am working on the Invoicing aspect. In QB, the process is to create an invoice, receive payment and then
      • Debit opening balances of vendors

        Dear colleagues: I am looking at the trial balance as on 31st March 2024, and punching opening balances (1st April 2024) in Zoho Books. Vendors have credit balances, by its nature, but some of our vendors have debit balances as well (e.g., we have paid
      • Zoho Books emails suddenly going to Spam since 11 Nov 2025 (Gmail + now Outlook) — anyone else?

        Hi everyone, We migrated to Zoho Books in July 2025 and everything worked fine until 11 Nov 2025. Since then, Zoho Books system emails are landing in customers’ Spam (first Gmail, and now we’re seeing Outlook/Office 365 also starting to spam them). Impacted
      • Tasks in hours rather than days.

        Hi there, I was wondering whether or not its possible to create a workflow task that has a timer based on hours rather than days? I'm looking to create a workflow task which, when a request field is changed, creates a task for the support desk to call the customer within an hour. However, the workflow task due dates only seem to work in days. Is this possible? Thanks
      • Client Portal ZOHO ONE

        Dear Zoho one is fantastic option for companies but it seems to me that it is still an aggregation of aps let me explain I have zoho books with client portal so client access their invoice then I have zoho project with client portal so they can access their project but not their invoice without another URL another LOGIN Are you planning in creating a beautiful UI portal for client so we can control access to client in one location to multiple aps at least unify project and invoice aps that would
      • The Social Wall: February 2026

        Hello everyone, This month, we’re bringing you a mix of exciting toolkit enhancements and a few improvements across the web and iOS app, all designed to make your social media management simpler and smoother. File converter Images come in different formats,
      • Zoho Mail and SalesInbox doesn't link to CRM record using Reply-To

        Hi, I've just set up SalesInbox, with the intention of using it for sales enquiries (instead of Desk, which I have been using until now). I've noticed that, unlike Desk, SalesInbox only uses the 'From' email address to attempt to link to a CRM contact
      • Service line items

        Hello Latha, Could you please let me know the maximum number of service line items that can be added to a single work order? Thanks, Chethiya.
      • Subforms and automation

        If a user updates a field how do we create an automation etc. We have a field for returned parts and i want to get an email when that field is ticked. How please as Zoho tells me no automation on subforms. The Reason- Why having waited for ever for FSM
      • Poor Search Results on Zoho CRM

        The search on Zoho CRM is quite poor. Salesforce has now published a new search, when will get this on Zoho? https://help.salesforce.com/s/articleView?id=data.c360_a_hybridsearch_index.htm&type=5
      • How to use filters on all products page? Or even a category page?

        Hello, I am trying to create some filters so users can use filters to find products they are looking for. So what i am trying is to create a filter according to price lets say. So if i define it this way i am expecting to see this filter option on category
      • Capture Last check-in date & days since

        I have two custom fields on my Account form, these are "Date of Last Check-In" and "Days Since Last Contact" Using a custom function how can I pull the date from the last check-in and display it in the field "Date of Last Check-In"? and then also display the number of days since last check-in in the "Days SInce Last Contact" field? I tried following a couple of examples but got myself into a bit of a muddle!
      • Pasted Images not being embedded in custom mail

        Hi, I'm making a custom report by email based on commentaries. I have the email ready, all working great except for images that are being pasted in the commentaries. Zoho deals with them as temp images and so it requires authentication to view them, something
      • AI Bot and Advanced Automation for WhatsApp

        Most small businesses "live" on WhatsApp, and while Bigin’s current integration is helpful, users need more automation to keep up with volume. We are requesting features based on our customer Feedbacks AI Bot: For auto-replying to FAQs. Keyword Triggers:
      • Bigin, more powerful than ever on iOS 26, iPadOS 26, macOS Tahoe, and watchOS 26.

        Hot on the heels of Apple’s latest OS updates, we’ve rolled out several enhancements and features designed to help you get the most from your Apple devices. Enjoy a refined user experience with smoother navigation and a more content-focused Liquid Glass
      • Select CRM Custom Module in Zoho Creator

        I have a custom module added in Zoho CRM that I would like to link in Zoho creator.  When I add the Zoho CRM field it does not show the new module.  Is this possible?  Do i need to change something in CRM to make it accesible in Creator?
      • Zoho CRM Quotes – Subform and PDF/Writer Limitations

        Hello, I am encountering the following limitations in Zoho CRM Quotes: Custom product images cannot be uploaded in the subform – the image upload field cannot be added; only the file upload field is available. File upload placeholders cannot be used in
      • Introducing Workqueue: your all-in-one view to manage daily work

        Hello all, We’re excited to introduce a major productivity boost to your CRM experience: Workqueue, a dynamic, all-in-one workspace that brings every important sales activity, approval, and follow-up right to your fingertips. What is Workqueue? Sales
      • Archiving Contacts

        How do I archive a list of contacts, or individual contacts?
      • Every time an event is updated, all participants receive an update email. How can I deactivate this?

        Every time an event is updated in Zoho CRM (e.g. change description, link to Lead) every participant of this meeting gets an update email. Another customer noticed this problem years ago in the Japanese community: https://help.zoho.com/portal/ja/community/topic/any-time-an-event-is-updated-on-zohocrm-calendar-it-sends-multiple-invites-to-the-participants-how-do-i-stop-that-from-happening
      • 3/18 オンライン勉強会のお知らせ Zoho ワークアウト (無料)

        ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 3月開催のZoho ワークアウトの開催が決定しましたのでご案内します。 今回はZoomにて、オンライン開催します。 ▶︎参加登録はこちら(無料) https://us02web.zoom.us/meeting/register/BoNTN7zYR8OvOPGShqBY0A ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目指すイベントです。
      • Zoho Sheet for Desktop

        Does Zoho plans to develop a Desktop version of Sheet that installs on the computer like was done with Writer?
      • Conversion Rate – Won Deals over Assigned Prospects

        Hello, I would like assistance configuring a KPI in Zoho Analytics titled: Objective of the calculation: Number of Won Deals divided by Total number of assigned prospects (not only converted prospects). Important clarification: The denominator must include
      • Perfomance Management - Zoho People

        Hi team, I am looking for performance management data such as KRA, goals, feedback, appraisals, etc., in Zoho Analytics. However, I am unable to find these metrics while editing the setup. Could you please confirm whether these fields are available in
      • Feature Request – Conditional Visitor Information Request in Zoho SalesIQ

        We would like to request the ability to conditionally ask for visitor details based on the communication channel used in Zoho SalesIQ. Specifically: When a visitor initiates a conversation through the live chat widget on the website, we want to continue
      • Apple Messages for Business in Omnichannel communications?

        Hello, Apple launched "Apple Messages for Business" but Zoho CRM or Zoho Desk don't appear in the list of possible integrators. Zoho already promotes https://www.zoho.com/crm/omnichannel.html Omni Channel integration, but Apple Messages does not yet appear.
      • Next Page