Kaizen #174 : Client Script Commands

Kaizen #174 : Client Script Commands


Hello everyone!

Client Script Commands feature is a highly anticipated functionality that enables users to trigger Client Scripts anywhere within Zoho CRM, extending the scope of client script beyond standard pages and events. In this Kaizen post, we'll explore how to implement and utilize this feature effectively.

In this post,


 

  1. What are Client Script Commands?

  2. How to create and use Client Script Commands?

    1. Using Command Palette

    2. Using Keyboard Shortcuts

  3. Scenario - 1

  4. Solution

  5. Scenario - 2

  6. Solution

  7. Summary

  8. Related Links

 


 

1. What are Client Script Commands?

Client Script Commands feature is another dimension of Client Script that enables users to trigger them anytime and anywhere in CRM, extending their event-driven functionality beyond just specific modules and pages. This functionality can be accessed through custom keyboard shortcuts or a command palette, making it easier for users to perform repetitive tasks quickly

2. How to create and use Client Script Commands?

Create a command by specifying the Category as Commands (instead of module) while creating a Client Script.




Check this documentation for more details.

To trigger a Command, you can use one of the following ways.

A. Using Command Palette
Click on the Command Palette icon in the footer of CRM and select the name of the Command that you want to trigger.



B. Using Keyboard shortcuts

You can also link each of the Commands to a shortcut key and trigger a Command using that designated shortcut key. Each user can set specific shortcuts based on individual preference and use them to trigger a Command.
Check this documentation for more details.

3. Scenario - 1

At Zylker, a financial company using Zoho CRM, Sales Advisors need a quick way to calculate EMI during customer phone calls. The solution should allow seamless access to an EMI Calculator from any page in Zoho CRM.

4. Solution

To achieve this in Zoho CRM,  you need to create a Widget for EMI calculator and create a Client Script Command.

A. Create a Widget for EMI calculator

  • Install Zoho CLI, and follow the steps given in this document to create the Widget app folder. Then update the html, javascript, and css code as per your requirement.

index.html

<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>

    <link rel="stylesheet" href="style.css" />

  </head>

  <body>

    <div class="loan-calculator">

      <div class="top">

        <h2>EMI Calculator</h2>

        <form action="#">

          <div class="group">

            <div class="title">Amount</div>

            <input type="range" min="1000" value="30000" max="50000" step="500" class="loan-amount" id="loanAmount" />

            <div class="slider-label">$<span id="loanAmountValue"></span></div>

          </div>

          <div class="group">

            <div class="title">Interest Rate</div>

            <input type="range" min="5" value="6" max="100" step="1" class="interest-rate" id="interesRate" />

            <div class="slider-label"><span id="interesRateValue"></span></div>

          </div>

          <div class="group">

            <div class="title">Tenure (in months)</div>

            <input type="range" min="6" max="100" step="1" value="12" class="loan-tenure" id="tenureMonth" />

            <div class="slider-label"><span id="tenureMonthValue"></span></div>

          </div>

        </form>

      </div>

      <div class="result">

        <div class="left">

          <div class="loan-emi">

            <h3>Loan EMI</h3>

            <div class="value">123</div>

          </div>

          <div class="total-interest">

            <h3>Total Interest Payable</h3>

            <div class="value">1234</div>

          </div>

          <div class="total-amount">

            <h3>Total Amount</h3>

            <div class="value">12345</div>

        <div class="right">

          <canvas id="myChart" width="400" height="400"></canvas>

        </div>

      </div>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/chart.js@3.6.2/dist/chart.min.js"></script>

    <script src="https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js"></script>

    <script src="main.js"></script>

  </body>

</html>

 

  • Click here to view the complete code.

  • Once you have added the code, upload the zip file by following the below steps.

  • Go to Setup > Developer Space > Widgets.

  • Click Create New Widget and Fill in the details.

 

  • The Hosting should be "Zoho" and mention the html page of the app folder that you uploaded.

 




Notes

Note:

The widget should be of "button" type in order to render through a Client Script.


B. Create Client Script Commands.

 

  • Configure a Client Script Command by specifying the Name and Description The Category should be Commands. Click Next. Click here to know how to configure a Client Script.

 

  • Enter the following script and click Save.



     ZDK.Client.openPopup({ api_name: 'emi_calculator', type: 'widget', header: 'EMI Calculator', animation_type: 4,  height: '750px', width: '500px', top:'100px',left: '500px' }, { data: 'sample data to be passed });



 

  • Here "emi_calculator" is the API name of the Widget,

    • Type is Widget,

    • Header is EMI Calculator,

    • animation type is 4 where the popup slides from the bottom.

    • The other parameters are optional and has default values as shown in the image.

  • Here is how the EMI Calculator appears as and when the salesperson needs. The user can either click on the Command Palette Icon at the footer or use a keyboard shortcut as per his convenience to open the calculator.


  • In the above gif, the keyboard shortcut is cmd O.

  • To customize the keyboard shortcut,

    Go to Setup → General → Personal Settings. Select "Motor" from the Accessibility Tab and Click "View Shortcuts" as shown in the below gif.



4. Scenario - 2

At Zylker, an international wholesale company using Zoho CRM, salespeople need a quick way to check real-time gold rates from different countries while discussing bulk orders with retailers. The solution should provide seamless access to updated, region-specific gold rates directly within the CRM interface to assist with accurate pricing decisions during customer interactions.

5. Solution

To achieve this in Zoho CRM, you need to create a Widget for EMI calculator and create a Client Script Command.

A. Create a Widget for gold rate

Install Zoho CLI, and follow the steps given in this document to create the Widget app folder. Then update the html, javascript, and css code as per your requirement.

index.html

<!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8">

<script src="https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js"></script>

<div class="container">

      <div style="display: flex;">

        <label for="country" style="width: 70%;font-weight: bolder;">Today's Gold rate:</label>

        <select id="country" onchange="updateGoldRates()" style="width: 30%;">

            

            <option value="USD" >United States</option>

            <option value="INR" selected>India</option>

            <option value="GBP">United Kingdom</option>

            <option value="AUD">Australia</option>

        </select>

      </div>

 

      <table id="goldRatesTable">

          <thead>

              <tr>

                  <th>Type</th>

                  <th>Rate (Per Gram)</th>

              </tr>

          </thead>

          <tbody>

             

          </tbody>

      </table>

  </div>

 

  <script>

      const goldRatesData = {

     };

 

      const symbol = ['₹', '$', '£', 'A$'];

 

      async function getLiveData (currency) {

        var myHeaders = new Headers();

        myHeaders.append("x-access-token", "goldapi-4wvh4nslzb5p0d5-io");

        myHeaders.append("Content-Type", "application/json");

 

        var requestOptions = {

          method: 'GET',

          headers: myHeaders,

          redirect: 'follow'

        };

 

        let response = await fetch(`https://www.goldapi.io/api/XAU/${currency}`, requestOptions);

        let res = await response.text();

      

        let data = JSON.parse(res);

 

        let desig;

        if(data.currency === 'INR'){

          desig = symbol[0];

        }

        else if(data.currency === 'USD'){

          desig = symbol[1];

        }

        else if(data.currency === 'GBP'){

          desig = symbol[2];

        }

        else if(data.currency === 'AUD'){

          desig = symbol[3];

        }

        goldRatesData[`${data.currency}`] = [

              { type: '24K Gold', price: `${desig + " " + data.price_gram_24k}` },

              { type: '22K Gold', price: `${desig + " " + data.price_gram_22k}` },

              { type: '18K Gold', price: `${desig + " " + data.price_gram_18k}` }

            ];

 

      };

 

      async function updateGoldRates() {

          var currency = document.getElementById("country").value;

          console.log("Event:: ",currency);

          const country = document.getElementById('country').value;

          const tableBody = document.querySelector('#goldRatesTable tbody');

          tableBody.innerHTML = '';

 

          await getLiveData(currency);

          if (country && goldRatesData[country]) {

              const rates = goldRatesData[country];

              rates.forEach(rate => {

                  const row = document.createElement('tr');

                  row.innerHTML = `

                      <td>${rate.type}</td>

                      <td>${rate.price}</td>

                  `;

                  tableBody.appendChild(row);

              });

          }

      }

      updateGoldRates();

 

      ZOHO.embeddedApp.on("PageLoad",function(res){

        document.getElementById('msg').innerText = res.data;

      });

 

      ZOHO.embeddedApp.init();

    </script>

  </body>

</html>

  • Once you have added the code, upload the zip file by following the below steps.

  • Go to Setup > Developer Space > Widgets.

  • Click Create New Widget and Fill in the details.

  • The Hosting should be "Zoho" and mention the html page of the app folder that you uploaded.

 

B. Create Client Script Commands

  • Configure a Client Script Command by specifying the Name and Description and click Next. Click here to know how to configure a Client Script.

 


Script

ZDK.Client.openPopup({ api_name: 'goldrate', type: 'widget',header: undefined, animation_type: 4, 

 height: '350px', width: '300px', top:'100px',left: '500px' }, { data: 'sample data to be passed' });

  • Click here to know more about openPopup().

  • Consider that the user has created the shortcut CMD G to trigger Client Script.

  • Here is how the Gold Rate appears as and when the salesperson used the shortcut keys CMD G.


6. Summary

We have seen,

  • how to use Client Script Commands

  • how to create keyboard shortcuts for Commands

  • how to view Widget as a popup using Commands

 

7. Related Links

    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner




                                                            • Sticky Posts

                                                            • Kaizen #197: Frequently Asked Questions on GraphQL APIs

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! 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 #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.
                                                            • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

                                                              Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
                                                            • Kaizen #193: Creating different fields in Zoho CRM through API

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! 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.
                                                            • Client Script | Update - Introducing Commands in Client Script!

                                                              Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ








                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • Open Sans Font in Zoho Books is not Open Sans.

                                                                                                              Font choice in customising PDF Templates is very limited, we cannot upload custom fonts, and to make things worse, the font names are not accurate. I selected Open Sans, and thought the system was bugging, but no, Open Sans is not Open Sans. The real
                                                                                                            • Zoho Writer - Option to Export as .zdoc format

                                                                                                              I've noticed that it's not possible to export a Zoho Writer Document in the .zdoc format. Isn't zdoc, Zoho Writer's own format? My use case is that I sometimes need to create quite complex documents with floating elements, which sometimes need to become
                                                                                                            • Is it possible for contacts to "Re-enter" a workflow in Zoho Campaign?

                                                                                                              We are currently working on a way to automatically add users to from one list to other lists based on specific criteria, but can't seem to find a native way of doing this so we are trying to use Workflows to do this. So, for example, if a user's status is set to "Active," then they should be added to the list "Active Users." If the same user's status is then set to "Paused," they should be added to the list "Paused Users" and removed from the list "Active Users." This works fine for the first go
                                                                                                            • Bulk upload images and specifications to products

                                                                                                              Hi, Many users have asked this over the years and I am also asking the same. Is there any way in which we can bulk upload product (variant) images and product specifications. The current way to upload/select image for every variant is too cumbersome.
                                                                                                            • Out of Office for Just One of My Alias Email

                                                                                                              Can I set up the Out of Office Reply for Just One of my Alias Email Addresses?
                                                                                                            • Can I map multiple Surveys into the CRM using the same fields?

                                                                                                              Hello, We are a healthcare practice that offers two distinct services (Nutrition and Primary Care). We use Zoho Survey for our lead generation form (Get Started Survey), which allows people to express interest in one of the two services and even allows
                                                                                                            • Dealing with API responses where integers have more than 16 digits

                                                                                                              Hi there How do I deal with an api response contaning an int or float with more than 16 digits (before any decimal places for a float). I constantly receive the response "Unable to cast the 'BigInteger' value into a 'BIGINT' value because the input is
                                                                                                            • Can not add fields to a Section

                                                                                                              I feel like I'm missing something obvious: I can add new Sections to my form but I can not add fields to the Sections. I've tried fields already on the form as well as dragging and dropping new fields into the Section but nothing will go into it. What
                                                                                                            • 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
                                                                                                            • To Zoho customers and partners: how do you use Linked Workspaces?

                                                                                                              Hello, I'm exploring how we can set up and use Linked Workspaces and would like to hear from customers and partners about your use cases and experience with them. I have a Zoho ticket open, because my workspace creation fails. In the meantime, how is
                                                                                                            • [Webinar] Automate sales and presales workflows with Writer

                                                                                                              Sales involves sharing a wide range of documents with customers across the presales, sales, and post-sales stages: NDAs, quotes, invoices, sales orders, and delivery paperwork. Generating and managing these documents manually slows down the overall sales
                                                                                                            • Can't change form's original name in URL

                                                                                                              Hi all, I have been duplicating + editing forms for jobs regarding the same department to maintain formatting + styling. The issue I've not run into is because I've duplicated it from an existing form, the URL doesn't seem to want to update with the new
                                                                                                            • Need Inactive accounts to be visible in Reports in Zoho Books

                                                                                                              I N=need Inactive accounts to be visible in Reports in Zoho Books to do recons of the accounts but when i see the same they are not visible in the Accountant - Account Transactions report
                                                                                                            • unblock e-mail

                                                                                                              please unblock my e-mails info@meatnews.gr and myrtokaterini@meatnews.gr
                                                                                                            • Add Zoho Mail for users who do not need Zoho One

                                                                                                              We have licenses for ZOho One for teams that need to use the suite of products that Zoho One offers.  We have 8 more people who only need email access and we would like to add just a Zoho Mail.  They do not need the Zoho One license.  We are currently
                                                                                                            • Zoho Projects - Q2 Updates | 2025

                                                                                                              Hello Users, With this year's second quarter behind us, Zoho Projects is marching towards expanding its usability with a user-centered, more collaborative, customizable, and automated attribute. But before we chart out plans for what’s next, it’s worth
                                                                                                            • ZML vs HTML Snippet - which is better?

                                                                                                              Are there certain use cases where one is better than the other?
                                                                                                            • Auto CheckOut Based On Shift.

                                                                                                              This Deluge script runs on a scheduled basis to automatically set the 'Actual_Check_Out' time for employees who haven't manually checked out. If the current time is past their scheduled 'Shift_End_Time', the script updates the check-out time to match
                                                                                                            • How to remove some users in zoho accounts

                                                                                                              How to remove some users in Zoho accounts.
                                                                                                            • Customizing Form Questions per Recipient Group in Zoho Campaigns/Forms

                                                                                                              Hello everyone, I would like to ask if it’s possible in Zoho Campaigns or Zoho Forms to send out a campaign where the form questions can be customized based on the group of recipients. Use case example: I have prepared 20 questionnaire questions. For
                                                                                                            • Infinite loop of account verification

                                                                                                              Hi I can't do anything on my zoho account.  I always get this message Hi Sheriffo Ceesay As a security measure, you need to link your phone number with this account and verify it to proceed further. When ever I supply the details, it displays that the number is associated with another account. I don't have any other account on zoho so this is really annoying. 
                                                                                                            • Load PO_Date field (Purchase Order) with current date in Deluge

                                                                                                              Hi, I'm not a full time developer, just helping to customize our CRM, in the small company I work for. There must be something wrong with me, because I can't do something so simple as complete a field with the current date in a function using Deluge.
                                                                                                            • Zoho CRM in Microsoft Power Automate Custom Connector

                                                                                                              Hi everyone, I’m building a Power Automate flow that integrates Microsoft Bookings with Zoho CRM. The goal is to automatically create a meeting (event) in Zoho CRM whenever a new appointment is booked via Microsoft Bookings. To achieve this, I created
                                                                                                            • Spell check sucks

                                                                                                              Come on guys, it's 2024 and your spell check is completely retarded. You gotta fix it.
                                                                                                            • How to include total km for multiple trips in expense report.

                                                                                                              Whenever I create a mileage report it only shows the total dollar amount to be reimbursed. The mileage for each individual trip is included but I also need to see the total distance for all trips in a report? How do I do this?
                                                                                                            • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

                                                                                                              Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
                                                                                                            • Outgoing blocked: Unusual activity detected.

                                                                                                              I just made payment for my Zohomail Today and have been debited so i will like to be Unblocked because this is what it says (Outgoing blocked: Unusual activity detected) Thank you i await your swift responses
                                                                                                            • Zoho One Login Issue - Unable to receive OTP

                                                                                                              Hi Support Team, I am experiencing a unique login issue with Zoho One. I am attempting to log in from India using Zoho Login credentials provided by a USA-based client. Their Zoho account is hosted on a US data center. After entering the username and
                                                                                                            • Question Regarding Managing Sale Items in Zoho Books

                                                                                                              Good day, I was wondering about something. Right now, Zoho Books doesn’t seem to have a way to flag certain items as being on sale. For example, if I want a list of specific items to be on sale from October 1 to October 12, the user would have to export
                                                                                                            • In the Zoho Creator Customer Payment form i Have customer field on select of the field Data want to fetch from the invoice from based on the customer name In the Customer Payment form i Have subf

                                                                                                              In the Zoho Creator Customer Payment form i Have customer field on select of the field Data want to fetch from the invoice from based on the customer name In the Customer Payment form i Have subform update Invoice , there i have date field,Invoice number
                                                                                                            • Problem of Import Client Users From CRM and or Expense

                                                                                                              I am premium plan user on Projects. I have about 500 customers on Expense and CRM that integrated with each other. According to at below link, I am trying to import clients from CRM, system not allowed to select any customer. If I import from Expense,
                                                                                                            • Unable to see free plan option

                                                                                                              Hello Zoho Support Team, I hope you are doing well. I am trying to sign up for Zoho Mail, but I am unable to see the option for the free plan. Could you please guide me on how I can access or activate the free plan? Thank you for your assistance.
                                                                                                            • unblock my zoho mail account. outlines@zoho.com

                                                                                                              please unblock my zoho mail account, outlines@zoho.com
                                                                                                            • domain not verified error

                                                                                                              Hi when i try to upload a video from zoho creator widget to zoho work drive iam getting domain not verified error.I don't know what to do .In zoho api console this is my home page url https://creatorapp.zoho.com/ and this is my redirect url:www.google.com.Iam
                                                                                                            • equest to Disassociate Bigin from Zoho One and Migrate to Standalone (Upgrade to Bigin Premier – 3 Seats, Annual)

                                                                                                              Dear Zoho One Support Team, I’m writing to request your assistance to disassociate (remove) the Bigin application from our Zoho One organization while preserving all existing Bigin data. After the disconnection is successfully completed, we intend to
                                                                                                            • SMTP email sending problem

                                                                                                              Hello, I've sent emails before, but you haven't responded. Please respond. My work is being disrupted. I can't send emails via SMTP. Initially, there were no problems, but now I'm constantly receiving 550 bounce errors. I can't use the service I paid
                                                                                                            • billing

                                                                                                              hi, I am being billed $12/year, and I can't remember why. My User ID is 691273115 Thanks for your help, --Kitty Pearl
                                                                                                            • Syncing Zoho Forms with Bigin - Embedding issue?

                                                                                                              Hello everyone, I created a Zoho Form for a page on my GoDaddy website to collect leads, which then transfers the data to Bigin. However, I'm facing an issue where it doesn't seem to work properly. I've integrated Zoho Forms with Bigin and tried embedding
                                                                                                            • How to add receipts

                                                                                                              How to add receipts
                                                                                                            • Unable to enable tax checkboxes

                                                                                                              Hi Zoho Commerce Support, I'm writing to report an issue I'm having with the tax settings in my Zoho Commerce store. I've created several tax rates under Settings > Taxes, but all of them appear with the checkbox disabled. When I try to enable a checkbox,
                                                                                                            • Next Page