Kaizen #115 :Customize Buttons using Client Script

Kaizen #115 :Customize Buttons using Client Script

Hello everyone! 

Welcome back to another interesting Kaizen post. In this post, we can discuss how to customize buttons using Client Script. 


In this kaizen post,
  1. Need for customizing buttons 
  2. ZDKs related to Buttons
  3. Use Case to customize button using Client Script
  4. Solution
  5. Summary
  6. Related Links

1. Need for customizing buttons

  • Enforcing Workflow Steps - By disabling certain buttons based on conditions, you can guide users through a predefined workflow. For example, if you want to notify the customer, when the order is in a particular stage, you can disable the button for other stages.
  • Customize buttons based on your business - You can modify button labels using Client Script to match your company's specific terms.If a button is part of a step-by-step process, change the label to match each step, making it more intuitive for users. 

2. ZDKs related to Buttons

Client Script empowers you to customize buttons and here is the list of ZDKs and Client Script functions to customize standard and custom buttons. 

  • getButtonByID(id)  - You can get the Pages' Button by ID.
  • getButton(api_name)  - You can get the Pages' Button by api name.
  • getButtons()  - You can get the list of buttons in the Page as an array.
  • getId() Using this, you can get the id of button.
  • getType()Using this, you can get the type of button.
  • getLabel()Using this, you can get the name of the button.
  • getApiName()  - Using this, you can get the API name of the button.

3. Use Case for customizing buttons:

      Zylker is a manufacturing company. The Sales representatives initiate the process by creating new deals in the CRM for potential customers or business opportunities.  So they are given the "create" permission. But in real time, there are high chances for an approved record to get cloned, which cannot be permitted. So, Zylker wants to disable the "Clone" button for users having a "Sales" profile.
As per their workflow, once the deal's stage is "Closed Won" a mail should be sent to the Manager and the customer. For this they have a custom button named "mail". But this mail button should not be sent when the deal is in other stages. To ensure this, Zylker wants to disable this button for all other stages of the deal.
Also, for better clarity, Zylker wants to rename the "save" button as "Create Deal" in the Create Page (Standard).

4. Solution:

As per the requirement, you need to create three Client Scripts. 
A. Disable "Clone" button Detail Page (Standard) when the page loads
B. Disable "Mail" button Detail Page (Standard) when the stage changes
C. Rename button in Create Page (Standard)

A. Disable Clone and mail buttons in  Detail Page (Standard)
  • Create a Client Script for  Detail Page (Standard) with onLoad Page event
  • For details about how to create a Client Script, click here.
  • Enter the following script and save.

 // Disable the standard "clone" button
var user = ZDK.Apps.CRM.Users.fetchById($Crm.user.id);
 if (user.profile.name !== 'Sales') {
var clone_btn = ZDK.Page.getButton('clone');
clone_btn.disable();
}

  • In the above script, "clone" is the api name of the standard button.
  • Here is the screenshot that shows the disabled "Clone" button for a user only with Sales Profile.

  • Here is the screenshot that shows the "Clone" button for a user with a non-sales profile user. That is, "Clone" button is not disabled for users having profiles other than "Sales" profile.


B. Disable "Mail" button Detail Page (Standard) when the stage changes
  • Create a Client Script for  Detail Page (Standard) with onChange field event for the field Stage.
  • For details about how to create a Client Script, click here.
  • Enter the following script and save.

// Disable the custom "mail" button
var stage_field = ZDK.Page.getField("Stage");
if (stage_field.getValue != 'Closed Won') {
   ZDK.Page.getButtons().find(a => a.getLabel() === 'mail').disable();
}
  • Here is the screenshot that shows the disabled "mail" button for a deal with the "Closed Won" stage.

  • Here is the screenshot that shows that "mail" button is not disabled for the deal in the "Value Proposition" stage.

C. Change the label for "save" button in Create Page (Standard)
  • Create a Client Script for Create Page (Standard) with onLoad Page event.
  • For details about how to create a Client Script, click here.
  • Enter the following script and save.


var save_btn = ZDK.Page.getButton('record_save');
save_btn.setLabel('Create Deal');


Here is the screenshot showing the "Create Deal" label instead of the "save" label.



Note

        Using Client Script, currently custom buttons can be disabled only in the Detail Page (Standard) and in the List Page (Standard).        


5. Summary

In this post, we have discussed,
  • How to fetch the label of buttons in Client Script
  • How to disable standard and custom buttons based on conditions
  • How to change the label of a button
  • ZDKs and methods available to customize buttons


Kaizen Collection : 

Click here to view our Kaizen Collection. Also, check our previous post Kaizen#114 - Geocoding Leads' Addresses in ZOHO CRM


We hope you found this post useful. We will meet you next week with another interesting topic!

If you have any questions let us know in the comment section.

Cheers!

    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.






                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts



                                                              • Sticky Posts

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

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

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

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

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

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


                                                              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

                                                                                                Get Started. Write Away!

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

                                                                                                  Zoho CRM コンテンツ






                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方




                                                                                                                • Recent Topics

                                                                                                                • Accepting Event from Outlook Client

                                                                                                                  I've noticed this behavior for a few years now. If an Event is created from CRM and sent to participants and the participant accepts the invitation using Outlook client, Zoho event won't be updated as "Going" it only works if the recipient accepts it
                                                                                                                • Is there an API endpoint to retrieve the remaining email credit balance?

                                                                                                                  Hi everyone, Is there any way to retrieve the remaining email credit balance programmatically through the API? I've gone through the full API documentation and it seems like there's no endpoint for this — everything related to credits is only visible
                                                                                                                • Switch between multiple LLMs instantly for tailored Zia experiences

                                                                                                                  Availability Editions: Professional , Enterprise, Ultimate , CRMPlus , ZohoOne Release Plan: Available for all DCs Hello everyone, Previously, the multi-LLM feature supported only one LLM at a time for Zia Record Assistant, which restricted users' flexibility
                                                                                                                • Zoho CRM Community Digest - April 2026 | Part 2

                                                                                                                  Hello Everyone! We're back with Part 2 of the April Zoho CRM Community Digest to wrap up our monthly roundup. This week, the spotlight is on smart database connections, proactive error tracking, and optimizing subform line items without breaking your
                                                                                                                • 【西日本初開催】「AI and DX Summit 2026」のご案内

                                                                                                                  ユーザーの皆さま、こんにちは! 西日本初開催となるZoho ユーザー / 検討中の方々向けイベントのご紹介です。 AI・DX大型カンファレンス「AI and DX Summit 2026」を、2026年7月16日(木)に開催します。 会場は、ウォルドーフ・アストリア大阪。 グラングリーン大阪直結のラグジュアリーな空間で、AIとDXの最新トレンド、実践事例、 展示、ネットワーキングが集結する、特別な1日をお届けします。 👉イベントページを見る ━━━━━━━━━━━━━━━ AIとDXの“今”を、体感。
                                                                                                                • Zoho Desk MCP doesn't expose all functions

                                                                                                                  Hello, I'd like to be able to draft (rather than send) ticket replies using Claude Cowork. However, the Zoho Desk MCP doesn't currently offer that, despite it being available in the API (https://desk.zoho.com/DeskAPIDocument#Threads#Threads_DraftEmailReply).
                                                                                                                • Stop by and explore our six updates in ABM for Zoho CRM

                                                                                                                  Dear Customers, We hope you're well! ABM for Zoho CRM is built to sharpen your database so that you engage with the right set of customer accounts. To fine-tune it further, we have six new updates: New access location for ABM Refined account entry criteria
                                                                                                                • Tracking Emails sent through Outlook

                                                                                                                  All of our sales team have their Outlook 365 accounts setup with IMAP integration. We're trying to track their email activity that occurs outside the CRM. I can see the email exchanges between the sales people and the clients in the contact module. But
                                                                                                                • Enhancement in Zoho CRM: Introducing New Return Types for String Fields Based on Character Length

                                                                                                                  Dear Customers, We hope you’re well! In Zoho CRM, formula field with string return type is used in various scenarios where text is involved like concatenating customers’ first and last names, trimming characters from texts, performing find and replace
                                                                                                                • Cross Module Filtering – Use Fields from Lookup modules in Custom Views criteria and Advanced Filters

                                                                                                                  Hello everyone, Zoho CRM now enables you to achieve deeper filtering of records in a module, using fields of a lookup, thereby enhancing your data management experience manifold. This filtering based on lookup module fields is now available in advanced
                                                                                                                • Incoming Rules: Define how incoming emails are evaluated and handled

                                                                                                                  As organizations grow, managing incoming emails manually becomes increasingly difficult. Administrators often need more control than what a standard spam filtering can provide. Whether that's enforcing company-wide email policies, handling messages from
                                                                                                                • Zia Emails Summary: Instant context from past emails

                                                                                                                  Hello all, Reading all of the past emails associated with a specific record can be tedious, which in turn makes it difficult to understand the context quickly, as these messages often include irrelevant details that waste time. This is true for everyone
                                                                                                                • Boost your CRM communication with new font types, sizes, and default reply-to options while composing emails

                                                                                                                  Hello Everyone, We’re excited to introduce a series of impactful enhancements to the email composer settings in Zoho CRM. These updates enable you to personalize and optimize your customer interactions with greater efficiency. So what's new? Add custom
                                                                                                                • Custom Portal URL causing SAMEORIGIN error with embedded Page snippet

                                                                                                                  In my app, I have a page that embeds another page. The URL that I have for the embedded page starts with https://creatorapp.zoho.com but the custom domain I have set up is https://kors.kerndell.com. Because the user logged into the app at https://kors.kerndell.com,
                                                                                                                • Automating CRM backup storage?

                                                                                                                  Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                                                                                                • Bing ads integration and tracking

                                                                                                                  Hi, Is there any way to track Bing ads in the same way that we are able to track google adwords?  It is important for us to be able to determine the conversion rate of our Bing ads.  If this is not possible now, will this feature be added in the future?
                                                                                                                • Zoho Creator Calendar - Sorting Events

                                                                                                                  Hi, I have a calendar view to hold the schedule for a group of engineers. I have created a formula field to show the combination of fields I want visible as the title of the event, but I need to be able to sort the list by something other than the event
                                                                                                                • Create a "My saved custom themes" section in Zoho Forms

                                                                                                                  Hi! I created lots of forms for my company that we embed on the website with a custon design. It is a pain not to be able to save a custom layout as a template and just not to have to do it again! So could you add a gallery like : "My saved themes" ?
                                                                                                                • Upcoming Update: Disposition Sync for Indeed

                                                                                                                  We’re updating our Indeed integration to support Disposition Sync, improving how candidate application statuses are communicated. This change is scheduled to go live on 15 June, 2026. What’s changing? Once enabled, this allows candidate application statuses
                                                                                                                • Joining Two Tables on Multiple Ids

                                                                                                                  Hello all, I'm guessing there is an obvious solution for this, but definitely not an expert in sql. On our Deals module, we have two user lookup fields. In Analytics, those fields have the user's ids in those table rows, and I'm trying to create a query
                                                                                                                • auto update of item purchase cost

                                                                                                                  Would be nice if, when entering bills, the price of the item varied from the stored item price, we could have a user dialogue "Update item price" | "yes / no". Simple, but saves a lot of additional work !
                                                                                                                • Journeys - How to set up a webhook that triggers when a contact meets the goal criteria?

                                                                                                                  Hi there, I'm setting up a journey on Marketing Automation. The main goal of the journey is to get the leads to reply our emails. Is there a way to trigger a webhook when that goal is met? The webhook would then trigger a notification. Is that possible?
                                                                                                                • Latest updates in Zoho Meeting | Personal Meeting Rooms and Zoho Meeting Annotator

                                                                                                                  Hello everyone, We’re excited to share a few updates for Zoho Meeting. Here's what we've been working on lately: Introducing Personal Meeting Rooms - Tailored for private discussions, this secure meeting space is yours alone, accessible via a unique link.
                                                                                                                • Canvases Auto-Skewing/Adding Scroll Bars When They Were Not There Prior

                                                                                                                  Is anyone else noticing rendering issues in their canvases today? It seems to be mainly icons which now have scroll bars added which makes them all look off, though some fields seemed to revert to squished length as well. Were the icons replaced with
                                                                                                                • New UI for Writer - Disappointed

                                                                                                                  I've been enjoying Zoho Writer as a new user for about 6 months, and I really like it. One of my favorite things about it is the menu bar, which you can hide or leave out while still seeing most of your page because it is off to the left. I think this
                                                                                                                • The reason I switched away from Zoho Notebook

                                                                                                                  My main reason for switching to Zoho was driven by three core principles: moving away from US-based products, keeping my data within India as much as possible, and supporting Indian companies. With that intent, I’ve been actively de-Googling my digital
                                                                                                                • Introducing the enhanced Zoho People integration

                                                                                                                  We're excited to announce an enhancement to the integration between Zoho Recruit and Zoho People, designed to streamline your data management processes and boost efficiency across your recruitment and HR workflows. With this latest update, you can now
                                                                                                                • Zia should track how customer relationships evolve over time

                                                                                                                  Here's a feature idea that I've been thinking about The Problem Zia is great at analyzing individual interactions email sentiment, call transcription, best time to contact. But here's what it can't do: tell you how a relationship has evolved over time.
                                                                                                                • Add an option to disable ZIA suggestions

                                                                                                                  Currently, ZIA in Zoho Inventory automatically provides suggestions, such as sending order confirmation emails. However, there is no way to disable this feature. In our case, orders are automatically created by customers, and we’ve built a custom workflow
                                                                                                                • Filter our rejected quote items from the inventory quote template

                                                                                                                  Hello, I am trying to have rejections at the line level on my quotes so I can track what items are often removed, I do not want to claim the whole quote as lost just the individual items for better data tracking. However I cannot figure out how to filter
                                                                                                                • Error AS101 when adding new email alias

                                                                                                                  Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                                • Gamescope is leveling upto Motivator for Zoho CRM

                                                                                                                  Hello,   As you are aware, we recently made Motivator for Zoho CRM available for Zoho One, CRMPlus and CRM Ultimate editions. Since Motivator has all the features of Gamescope and even more advanced gamification, we are planning to EOL Gamescope on 30th
                                                                                                                • Print JV of an Expenses in ZohoBooks

                                                                                                                  When an expense is created in Zoho Books, the related journal entry can be viewed at the bottom of the expense record. However, when printing the expense, the journal entry is not included in the printed document, and there does not appear to be an option
                                                                                                                • Kiosk waiting for completion breaks previous field updates from occurring, yet timeline of record show changes

                                                                                                                  hi 1) I set to statuses on a Get record . 2) Next i run a function and capture the result i.e. wait for completion 3) Then a Screen The record's timeline show the status changes. Yet the record has not changed. I can repeat this. I had another route in
                                                                                                                • Write-Off multiple invoices and tax calculation

                                                                                                                  Good evening, I have many invoices which are long overdue and I do not expect them to be paid. I believe I should write them off. I did some tests and I have some questions:  - I cannot find a way to write off several invoices together. How can I do that,
                                                                                                                • Partner with HDFC And Sbi Bank.

                                                                                                                  Hdfc and sbi both are very popular bank if zoho books become partner with this banks then many of the zoho books users will benefit premium features of partnered banks.
                                                                                                                • Print shipping label on Zebra Label printer from ZOHO Creator deluge

                                                                                                                  Hi All, Allow me to guide you through the process of printing a shipping label from ZOHO Creator to a Zebra label printer (ZD421D). Step 1: To start, configure the SendFileToPrinter API, which enables the transmission of a file to a Zebra Link-OS printer.
                                                                                                                • Zoho Books Placeholder: Inventory Counts

                                                                                                                  I was hoping to figure out how to find the placeholders for inventory counts by item. We use Location based inventory tracking, so I dont know if that affects things. I want my PDF and Printed PICK LISTS to show the Quantity Available to Pick. I have
                                                                                                                • Can't delete shared mailbox emails from mobile app

                                                                                                                  I have the mobile app on iOS and cannot seem to find a way to delete an email from a shared mailbox. Is there something I'm missing here? Michael
                                                                                                                • Simple Custom Function to Update Candidate status

                                                                                                                  Hi folks, We are currently using Zoho Recruit and have sources from where candidates are applying. Currently all candidates are being set to 'Associated' when they apply via 3rd party sources but that is not useful for us under our business process. I
                                                                                                                • Next Page