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

    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Kaizen #261 : Using Zoho CRM Skill to generate complex COQL queries

      Hello everyone, In the previous Kaizen posts, we introduced the zoho-crm SKILL.md and discussed how it can help you when you are working with Zoho CRM APIs and Client Script. In this Kaizen, we will focus on using the Zoho CRM `SKILL.md` with GitHub Copilot
    • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

      Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
    • 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
    • Recent Topics

    • this is getting ridiculous

      My checking account bank feeds haven't worked since 6/4/21.  Multiple emails to Zoho since 6/10, and all they tell me is they have re-escalated my problem to their banking service provider team.  14 days and nothing is fixed. I'm just about ready to bail
    • No feedback from Zoho Books regarding Yodlee feeds for Investec

      I reported on 6 Feb 2025 that the Bank Feeds for Investec bank via Yodlee are not working. To date there has been no resolution. You are charging us for a suite of products where the functionality does not work. Please advise how you will refund me for
    • ongoing bank sync problems

      My bank feed broke May 14th 2021 Since then I just get an endless stream of we are working on it, "Kindly bear with us for sometime" from support Multiple times I have asked to speak to managers and half the time they don't call at all. If they do call
    • We must admit - Yodlee is an unreliable partner!

      Hello Zoho, Our Yes Bank account intergration is messed up since the beginning and the problem has not been addressed yet. With bad synchronization, poor categorization of transactions, duplicate/unknown copies of accounts, no support, geared at income/expenses,
    • Make your PDFs clearer with shapes

      Sometimes the best way to mark up a PDF is to point at it directly. Zoho PDF Editor includes shape tools that let you add circle, check and cross marks anywhere in your PDF, so you can flag content for review without extra comments. Here's what you can
    • Admin Logging in as another User

      How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
    • Project Migration

      We currently have two separate Zoho organizations: A Spark Robotic organization under Zoho CRM Plus A separate Contract Manufacturing organization under Zoho One We are working with Zoho Support to consolidate the CRM Plus organization into our existing
    • Improved Filtering and Tagging options for Notes

      We rely on the notes section across several modules and would love to have some more options in filtering, grouping, and tagging notes. We would like to be able to filter notes differently on a contact or deal and have that choice stay on that record
    • Action required: Update the Zoho Desk Client SDK URL in your extensions

      Hi Developers, To improve reliability and performance, the Zoho Desk Client SDK is now served from a new CDN domain. We request that you update your existing extensions with the new Client SDK URL given below. Note: Going forward, all newly created extensions
    • Decoupling Email Sending from Storage in CRM & Email Storage Add-on Purchases

      Hello everyone, We are excited to announce the rollout of the second phase of our email storage management, designed around a simple principle: your business communication should never be disrupted by storage limits. We've decoupled email sending from
    • Edit PDFs using Zoho PDF Editor

      Hello users, In a previous article, we covered the organizing capabilities of Zoho PDF Editor. Here, we'll provide a quick recap of its editing features, including a few new additions. A few highlights of Zoho PDF Editor's editing capabilities: Add and
    • Feature Request - Ability to Customise Contact Info Card on Ticket Details View

      Hi Desk Team, I've added a "Contact Priority" and "Account Prioirty" field and it would be very useful to agents if they could see that information in the Contact Info card on the Ticket Details view. It would be great if we could choose some fields to
    • What is a realistic turnaround time for account review for ZeptoMail?

      On signing up it said 2-3 business days. I am on business-day 6 and have had zero contact of any kind. No follow-up questions, no approval or decline. Attempts to "leave a message" or use the "Contact Us" form have just vanished without a trace. It still
    • Customer portal: recommended way to scope lookup fields to the logged-in client?

      Hi all, I'm building a customer portal on Creator for our clients (we're a esting lab, so each client has their own sites, contacts and jobs). Planning stage, so I'd rather get the approach right before I build it. The portal forms need several lookup
    • Zia for Mail: AI-powered assistance for Email, Calendar, and ToDo in Zoho Mail

      Zia for Mail brings AI assistance into Zoho Mail for everyday email, calendar, and task activities. Administrators can integrate third-party AI providers, such as ChatGPT or Gemini, and decide which features are available to users. What is Zia for Mail
    • "Else / If" Statement in Zoho CRM Inventory Template

      Hello, I would like to use the below "Else If" in my Inventory Templates, but it's not working correctly. Essentially, if the field "Quote Payment Terms" is filled in, display that. If "Quote Payment Terms" is blank, display "Account Payment Terms" instead.
    • Office Integrator

      Our users are complaining the slowness and speed when working in Zoho Office. Explicitly when working in a sheet. Here are observed issues *Copy and pasting values from one cell into another takes 10-20 seconds to show it has done it. *Modifying a value
    • Subform UI Unresponsive

      Has subform with a couple of hundreds of rows but suddenly the you can't add any row nor edit any fields. The subform has 10 columns Any thoughts on this Zoho team?
    • Kaizen #267: Four Developer Tools, One Prompt: Cracking Custom Cases with the Zoho CRM Skill

      Hello everyone! Welcome back to another Kaizen post. In this Kaizen, we’ll see how the Zoho CRM Skill solves a custom use case that requires multiple Zoho CRM developer tools. You describe the requirement in plain language, and the skill identifies the
    • 【開催報告】 福岡 ユーザー交流会 NEXUS 2026/10/30 | CRM×AIの実践事例とZia Agents活用を紹介

      Zoho ユーザーの皆さん、こんにちは。 コミュニティグループの中野です。 10月30日(金)、福岡にてZoho ユーザー交流会 NEXUSを開催しました。 今回は、Zoho CRM × AIをテーマに、ユーザーさんによる実践事例、 Zia Agentsのデモ、参加者同士のグループワークなどを実施しました。 ご参加いただいた皆さん、ありがとうございました! 本投稿では、当日の様子を一部ご紹介します。 ユーザー活用事例 :Zoho CRM × AIを、実際の営業業務でどう使う? 登壇者:株式会社etika
    • Service Account Admin for API Calls and System Actions

      Hello, I would like to request the addition of a Service Account Admin option in Zoho product. This feature would allow API calls and system actions to be performed on behalf of the system, rather than an active user. Current Issue: At present, API calls
    • Trigger workflows from SLA escalations in Zoho Desk?

      Hey everyone, I’m currently working with SLA escalation rules in Zoho Desk and ran into a limitation that I’m hoping someone here has solved more elegantly. As far as I can tell, SLA escalations only support fairly limited actions (like changing the ticket
    • Zoho One - Can I add a Custom View to All Departments

      We have been using Desk for several years but are just making the leapt to using multiple departments. I have a custom view that is our default view. I'd like to apply that to All Departments. When I try to add a view when viewing All Departments I get
    • A way to create kits (groups of items) that do not require bundling and are added to an order as the individual items

      We are evaluating moving off of Sage BusinessWorks (which handles accounting, order entry, inventory control, accounts receivable, etc) to Zoho Books/Inventory. One of the things we heavily use is a feature called Kits, which allows creating a group of
    • Zoho Campaigns 3.0 is here

      Zoho CampaignsAnnouncements We're excited to introduce the all-new Zoho Campaigns, where we have introduced our biggest update yet. Marketing has evolved far beyond email. Today's campaigns span email, SMS, and WhatsApp, customers expect personalized
    • Tip #95 – Collect support requests right from your website with Web Forms – 'Insider Insights'

      Hello Zoho Assist Community! When a customer needs help, the first step often decides how smooth the rest goes. They email a vague description, a technician asks follow-up questions, and the real details only surface after several rounds of back and forth.
    • E-Invoicing Automation

      Do you have an API endpoint for pushing the invoice through the e-tims for Kenya
    • Automation Series: Automate Project File Uploads from Zoho WorkDrive

      Project documents are often prepared before development begins. When files such as product requirements, design files, guidelines, or plans are stored in a shared folder in Zoho WorkDrive, teams can automate copying them to the corresponding project team
    • Is it possible to report on Task Duration in minutes/hours rather than by start and due date?

      I'm currently evaluating the free version of CRM and I like lots of things about it, it will definitely help my business with sales automation and I will upgrade to a paid version once the evaluation is finished. However, I also want to use CRM for existing clients (accounts) where I can track how much time is being spent on tasks for these clients.  I can see clearly that both calls and events for each account have time tracking in minutes / hours but tasks do not have this. Is it possible in one
    • Why is it so hard to get a fiscal YTD P&L report in Zoho Books?

      Yes I know that it could be done in Zoho Analytics, but I would have expected this default report view to be easily accessible in the list of Books accounting reports. Just like any other basic accounting system, I'm looking for monthly columns of the
    • ¡Nuevo Meetup en Barcelona! - Automatiza procesos con los agentes de Zia en Zoho

      ¡Hola a todos! Estamos encantados de anunciaros que el próximo 3 de diciembre estaremos en Barcelona con un nuevo Meetup de Español Zoho Community. Estos encuentros son una oportunidad fantástica para conectar con otros usuarios de Zoho, ampliar conocimientos
    • Stock count by bin location

      Is there a configuration to make a stock count by bin or area and not by product. these is useful to manage count by area Regards
    • Bank Feeds - Again

      Bank feeds broken again for me. I don't see other recent posts on this, so maybe it's just us? Tried: refresh update cred/ deact./react. feeds chat support Nothing. On day 2 without zoho as a result, which is crippling for us. We've used zoho for a year
    • Introducing Auto Check-out for Attendance

      We are pleased to announce the release of the Auto Check-out feature in Zoho People. Auto Check-out is now available as a built-in setting under Shifts to automatically check out employees who have not recorded their check-out for the day. Administrators
    • Issue with SalesIQ Chats Automatically Closing Due to the 24-Hour Idle Timeout?

      Hello, I am experiencing a significant issue with SalesIQ automatically closing chats due to the Idle Timeout setting. I use SalesIQ through the integration between SalesIQ and Line App. To be honest, this issue has become extremely frustrating. Problems
    • ChatGPT Plugin / MCP Server auth error

      Hi all I'm trying to connect the ChatGPT plugin for Zoho CRM but after username stage of the auth process, I get this error from the URL https://mcp.zoho.eu/mcp-client/ {"error_description":"Invalid request url, Request is not as per defined in oauth
    • Zoho Amount Cell Greyed Out

      I noticed a few days ago that the 'amount' cell on my Zoho App software in my windows PC is greyed out and I can't click on it to add an amount figure when recording invoice or expenses. Wheareas on mobile I can do it easily
    • 申請メール、まだ一件ずつ確認していませんか?― Zoho Formsで申請業務を効率化

      ユーザーの皆さま、こんにちは。ゾーホージャパンの友田です。 「備品を購入したいので申請します」 「イベントに参加したいです」 「経費の申請をお願いします」 このような社内申請を、メールやチャットで受け付けていませんか? メールでも申請はできますが、 「必要な情報が書かれていない」 「申請内容をあとから一覧にまとめている」 「誰がどこまで確認したのか分からない」 といった手間が発生することも。 そんな申請業務にも、Zoho Formsを活用できます。 必要な情報を、フォームでまとめて入力 例えば、備品購入の申請なら、
    • URGENT: Zoho Wiki searches return garbled nonsense

      For at least the past few days, the Search function in Zoho Wiki has been returning only strings of random characters. Example search result: The page name is readable, but the context body text is gibberish. So something is obviously broken with either
    • Is it really true that I can't set the default 'deposit to' account in 2025?

      I've been using Books for 7 years and the default account has never been a problem. I usually manually reconcile invoices and have never had a thought about which account. It has always been my account. However, I recently noticed that for the past 4
    • Next Page