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





                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                      • Ask the Experts



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep 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

                                                                                                  • Desk Contact Name > split to First and Last name

                                                                                                    I am new to Zoho and while setting up the Desk and Help Center, I saw that new tickets created or submitted from the Help Center used the Contact Name field. This would create a new Contact but put the person's name in the Last Name field only. The First
                                                                                                  • Enhancing self-service capabilities with AI-based Zia Answer Bot

                                                                                                    Hello All, Zia Answer Bot is available with better accuracy to enhance the self-service capabilities of the platform and to empower the users to resolve queries independently. By leveraging knowledge base (KB) resources, the Answer Bot provides accurate
                                                                                                  • Expand Zia's Language Support and AI Capabilities

                                                                                                    Dear Zoho Desk Support, I would like to submit a feature request to improve Zia, the AI-driven support assistant in Zoho Desk. Currently, Zia only supports the English language, while other AI agents such as Gemini, ChatGPT, and Claude can work with a
                                                                                                  • Automated Messages in Zoho Desk - WhatsApp

                                                                                                    Hi, We set-up an automated message reply to our whatsapp channel for our support that was connected to the zoho desk. I need to change these automated messages but am unable to find the place where I can make these changes. Anyone able to assist?
                                                                                                  • Adding Attachment to Desk Ticket via Deluge

                                                                                                    Hello, My team has a process where some people are entering information into a workbook in Zoho Sheet, and we need to get a copy of workbook into a ticket in Desk. We currently have a 'Submit' button on the Sheet that triggers a webhook to Flow, and from
                                                                                                  • Launching CPQ for Zoho CRM! An in-built solution for bespoke quote management

                                                                                                    Hello everyone, We are thrilled to announce the public release of CPQ (Configure, Price, Quote) for Zoho CRM, which is a fundamental block in sales management. NOTE: CPQ was a public early access feature from March 2023 — January 2024. Since February
                                                                                                  • Zoho Creator Get Records Integration Task

                                                                                                    Trying to use Zoho Creator's Get Records integration task to fetch records from a specified report in Zoho Creator: https://www.zoho.com/deluge/help/creator/get-records.html However, I continue to receive a code 2894 error saying that the report is not
                                                                                                  • spark sync problem with iphone

                                                                                                    Hello, I am using the spark application on iphone 15 pro max and 16 pro max. After several days of installing the account on spark i dont get notifications on new emails, i have to open the app in order to receive the new emails. After sending email to
                                                                                                  • Issues with GC Integration and Ticket Retrieval in Instant Messaging

                                                                                                    I am using Guided Conversations (GC) within Instant Messaging (IM) channels. When a user sends a message, a ticket is created in Desk, but GC cannot identify which ticket it corresponds to. To address this, I have implemented a workflow rule to rename
                                                                                                  • Localhost works fine, but issue come Zoha mailer on live server

                                                                                                    package.json "proxy": { "/auth/google": { "target": "http://localhost:8000/" } }, ContactForm.jsx import React, { useState, useEffect } from 'react' const ContactForm = () => { const [fname, setFname] = useState(""); const [lname, setLname] = useState("");
                                                                                                  • Set Mandatory Lookup Fields in Ticket Layout

                                                                                                    I added a custom module called 'Site' in the desk. I also added a lookup field 'Site' in the ticket layout. Now, I want the 'Site' field to be mandatory in the blueprint transition. How can I do that?
                                                                                                  • Ability to Initiate WhatsApp Template Messages in Zoho SalesIQ Without Preexisting Chat

                                                                                                    Hi Zoho SalesIQ Team, I hope you're doing well. I understand that with the WhatsApp integration in SalesIQ, clients can contact us via WhatsApp, and we can use WhatsApp templates to send messages outside of the 24-hour window by reopening an existing
                                                                                                  • CPQ Quantity suggestion does not allow multiple products

                                                                                                    I have come across an issue in the CPQ Product Configuration. I want 10 products to trigger the suggestion of an additional product via the quantity in quoted items function. However, when specifying the configuration, I am only able to choose one base
                                                                                                  • Work Orders / Bundle Requests

                                                                                                    Zoho Inventory needs a work order / bundle request system. This record would be analogous to a purchase order in the purchasing workflow or a sales order in the sales cycle. It would be non-journaling, but it would reserve the appropriate inventory of
                                                                                                  • Email content strategy

                                                                                                    This is basically a couple of questions about the best practices when it comes to the use of colors as part of the message sent through the email campaign. 1 - Is there a guide or recommendation as to what are the best colors for text/background associated
                                                                                                  • Bill Of Material

                                                                                                    Can anyone tell me how to generate Bill of  Material (BOM) in zoho. _Thanks and regards, Dinesh A.
                                                                                                  • How to extract URL parameters with Zoho Flow

                                                                                                    Hello, I try to extract different parameters like UTM and Ads platform id like MSCKLID. Ex. mydomain.com/?utm_source=1234 They aren't necessarly all filed due to the usage of different platform. I have a field with the URL in Zoho CRM I have individual
                                                                                                  • Weekly Tips: SecurePass For Extra Security

                                                                                                    Imagine sensitive data from your organisation sent via email is being accessed by unintended recipients. The sensitive data can range from Personal Identification Information to a tender quotation or a client’s NDA document. The unintended access could
                                                                                                  • Paid Support Plans with Automated Billing

                                                                                                    We (like many others, I'm sure) are designing or have paid support plans. Our design involves a given number of support hours in each plan. Here are my questions: 1) Are there any plans to add time-based plans in the Zoho Desk Support Plans feature? The
                                                                                                  • Delete a department or category

                                                                                                    How do I delete a Department?  Also, how do I delete a Category? This is pretty basic stuff here and it's impossible to find.
                                                                                                  • No puedo enviar correos, outgoing blocked

                                                                                                    No puedo enviar correos, me sale un mensaje de error outgoing blocked. Pueden revisar y desbloquear la cuenta. Gracias
                                                                                                  • Open A.I assistant Connect with Zoho Desk instant Message Conversations

                                                                                                    I would like to know how do I connect my instant messenger in Zoho desk with my Open A.I Gpt Assistant. this is very easy to setup using the Salesiq Zobot but when it comes to Zoho Desk i cannot figure how to make the connection. Ideal workflow Customers
                                                                                                  • Reopen and Continue WhatsApp Chats within 24-Hour Window

                                                                                                    Dear Zoho SalesIQ Team, I'm writing to request a new feature that would enhance WhatsApp communication management within the 24-hour window: the ability to reopen and continue conversations with customers after a chat has been closed from our end. Current
                                                                                                  • How to Initiate WhatsApp Message on SalesIQ?

                                                                                                    I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                                                                                  • Cannot create alias, getting AS101

                                                                                                    The error AS101 is shown while I try to add the alias. How can I fix that?
                                                                                                  • BOLETO PARA PAGAMENTO

                                                                                                    Gostaria de saber como faço para pagar o boleto de licença anual do o email do zoho
                                                                                                  • CAIXA DE E-MAIL BLOQUEADA

                                                                                                    Obrigado, bom dia! O e-mail financeiro@grupoa7.com.br está com a caixa de e-mail bloqueada e já apagamos alguns e-mails e agora estamos tentando fazer backup dos mais antigos e não estamos conseguindo. Poderiam nos ajudar?
                                                                                                  • Email sent from Automated system on Oracle Netsuite of my customer not being received in my zoho mail

                                                                                                    My customer is using Oracle Netsuite to send us enquiries and PO's. It is strange that these are not being received in my Zoho Mail account. It is not even bouncing back. I am not sure why is it is not being shown. I wrote to support@zoho.com but the
                                                                                                  • Paypal Payaments Pro not available in our live account.

                                                                                                    We have a test environment set up and one of hte payment gateways is paypal payments pro. This option is not avaiable in our live account and the regular paypal gateway says auto-charge not available. Why does paypal payments pro not appear in our live
                                                                                                  • Diagnostic-Code: 4.7.650

                                                                                                    Good Afternoon! Today i had this problem with all the emails that i sent... The original message was received at Thu, 23 Jan 2025 11:44:20 -0800 from vxxxxxxx@fxxxxxx.mx [vxxxxx@fxxxx.mx] ----- The following addresses had fatal errors ----- [sxxxxxxxxxxxxxxxxx@hxxxxxxx.com]
                                                                                                  • Adding Markdown text using Zoho Desk API into the Knowledge Base

                                                                                                    Hi Zoho Community members, We currently maintain the documentation of out company in its website. This documentation is written in markdown text format and we would like to add it in Zoho Knowledge Base. Do you know if there is REST API functionality which is able to support this operation ? Thank you in advance, Leandros
                                                                                                  • Firebase Functions integration

                                                                                                    Hello Zoho Team, Please advise how I can configure SMTP in my account to facilitate Firebase-triggered email functions. Please note that I desire to send an email with a JSON object collected from Firebase Firestore and included in my mail to forward
                                                                                                  • Cant connect my Zoho Email to Apollo.io account

                                                                                                    Im trying to add my Zoho email to my Apollo account in order to be able to send emails through Apollo but I keep getting time out error. In order to set the email account there is a small form in Apollo I have to fill. For email and password I use the
                                                                                                  • I am having issues with my Zoho Mail account;

                                                                                                    I am having issues with my Zoho Mail account; I am unable to send or receive emails and need to reactivate my account. I am receiving the following message: "This message was created automatically by the mail delivery system. THIS IS A WARNING MESSAGE
                                                                                                  • User Filter for Dynamic Date Dimensions in Zoho Analytics

                                                                                                    One challenge I frequently encounter is the need to create multiple versions of the same report—one for yearly data, another for quarterly data, another for monthly, and so on. While this works, it leads to unnecessary duplication, making maintenance
                                                                                                  • Zoho CRM - COQL query failing with no reason

                                                                                                    Hi I'm trying to execute a COQL query but it's returning an error. Unfortunately I cannot understand where I'm wrong The query is the following;: URL: POST https://www.zohoapis.com/crm/v2.1/coql Body: { "select_query": "select id,Adjustment,Billing_City,Billing_Code,Billing_State,Billing_Street,Buyer_PO_Number,Delivery_Date,Delivery_Method,Due_Date,Grand_Total,Invoice_
                                                                                                  • Does anyone know what is the time frame for our Tickets to be attended to?

                                                                                                    4 Days ago I sent a ticket to check if our vendor's email address/domain is listed as spam because for some reason, their emails kept being bounced back and we did not receive any notification. As of yet, I have not received any indication that my query
                                                                                                  • Linking an email to a Contact when the email is sent in deluge via sendmail

                                                                                                    The "to:" address in this code is a CRM Contact. Email address is forced unique in CRM This sendmail gets sent via a workflow which is in a custom module. It works, except that the outbound email does not appear (i.e, get linked to) the Contact such that
                                                                                                  • Re-emphasizing the importance of Domain Whitelisting in ASAP's JWT Authentication Mechanism

                                                                                                    The problem We discovered a security vulnerability related to using OAuth tokens in non-whitelisted domains and have reinforced our security measures. If you experience any request failures in the authorized domains, please verify that they are whitelisted
                                                                                                  • How do you arrange order in which the speakers are listed in a session once they have been selected?

                                                                                                    Probably another simple thing I've missed but I can't find how to arrange the order in which the speakers are listed in a session once they have been selected. We usually want the speakers listed alphabetically by last name, but sometimes not. Once the
                                                                                                  • Next Page