Kaizen #186 : Client Script Support for Subforms

Kaizen #186 : Client Script Support for Subforms



Hello everyone!

Welcome back to another exciting Kaizen post on Client Script! 

In this edition, we’re taking a closer look at Client Script Support for Subforms with the help of the following scenario.

" Zylker, a manufacturing company, uses the "Orders" module to place Orders . They fill in a subform called "Product List". Now, the Admin wants to enforce the following restrictions on this subform in detail page:
  • Disable row deletion
  • Prevent cloning and adding rows
  • Make the "Unit Price" field read-only for salespersons "

In this post,

  1. What are Subform event
  2. Possible actions in Subform using Client Script
  3. Use Case
  4. Disable row deletion within the subform
  5. Prevent cloning and addition of rows in subform
  6. Make the "Unit Price" field read-only for salespersons
  7. Summary
  8. Related Links


1.What are Subform Events

Subform events are triggered by user actions, such as adding or deleting rows or updating data in subform. These events allow you to run Client scripts for validation, automation, or dynamic updates. Here is the list of subform events.
  • onCellChange – Triggered when a cell value is changed and the keyboard or mouse focus moves out of the subform cell.
  • onRowAdd – Fires immediately after a new row is added in a subform.
  • onRowDelete – Executes right after a row is deleted from a subform.
  • beforeRowDelete – Invoked before a subform row is deleted; can be used to prevent deletion.
  • beforeRowUpdate – Triggered before a subform row is updated on Detail pages; useful for validations or preventing changes.
Click here to know more about Subform Events.
These events are supported in the following Pages of Zoho CRM
  • Standard - Create/Edit/Clone Pages, Detail page
  • Canvas - Create/Edit/Clone Pages, Detail page
  • Wizard - Create/Edit Pages
2. Possible actions in Subform using Client Script




Click here to view the detailed documentation about the Client Script ZDKs related to Subform.

Notes
 Note :

The setValue() method for a subform row and cell on the Detail Pages will only work when the row is in edit mode.

3. Solution

To accomplish the solution for the use case (stated at the beginning of the post), you need to create the following Client Scripts in detail Page.

3.A. Disable row deletion within the subform

  • Go to Setup > Developer Space > Client Script. Click +New Script.
  • Specify the details to create a script. 
  • Click Next.


Script :

  1. ZDK.Client.showAlert("Deleting rows is not allowed here");
  2. return false
  • This script blocks row deletion and shows an alert message.

  • Here is the syntax of showAlert().


  • You can see that the Client Script Triggers an alert message and prevents the deletion of rows.



3.B. Disable adding and cloning of rows in subform
  • Go to Setup > Developer Space > Client Script. Click +New Script.
  • Specify the details to create a script. 
  • Click Next.


Script: 

  1. ZDK.Client.showAlert("Adding and cloning rows is not allowed in this subform")
  2. return false;
  • You can see that the Client Script Triggers an alert message and prevents the addition of a new row. 



3.C. Make the "Unit Price" field read-only for salespersons

  • Go to Setup > Developer Space > Client Script. Click +New Script.
  • Specify the details to create a script. 
  • Click Next.

Script:
  1.   var user = ZDK.Apps.CRM.Users.fetchById($Crm.user.id);
  2. if (user.profile.name == 'Salesperson') {
  3.     var field_obj = ZDK.Page.getSubform("Product_list").getField('Unit_Price');
  4.     field_obj.setReadOnly(true);
  5. }

  • Here, 
  • $Crm refers to the Client Script Constant.





  • Click here to know more about other ZDKs and functions related to Client Script.
  • Here is how Client Script works.




Summary

1. What are the events available for subforms
2. What are the supported actions in subforms
3. How to make a field read only in a subform for a particular profile
4. How to prevent adding rows to a subform.

Related Links

Idea
Previous Post: Kaizen 185 - Subqueries in COQL AP |  Kaizen Collection: Home



      Zoho Campaigns Resources


        • 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

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ



                                ご検討中の方

                                  • Recent Topics

                                  • Can't view nor download attachments

                                    Me and a number of people I know suddenly stopped being able to either view nor download attachments that arrive in new emails we receive since this morning. Older emails work just fine and we can download/view them. Zoho Mail states the it wasn't able
                                  • Zoho CRM APIs

                                    Hello, I think as a developer, it is very important to have the ability to manage, develop, and execute functions directly from my local development environment (for example, VS Code). Zoho CRM should have a way to create, deploy, and manage functions
                                  • Record Payment - Auto Populate Amount as payments are selected

                                    When recording payments you have the option of clicking on "Pay in Full" next to the bill which automatically adds the total at the bottom of the page next to "Amount used for payments" but this should also auto populate / update the total at the top
                                  • Zoho Projects - Add Event Change as Trigger

                                    I am currently trying to create an automation in Zoho Flow that sends a notification when an Event is updated in Zoho Projects. At present, Zoho Projects only provides a trigger for Event creation. There is no trigger available when an existing Event
                                  • Tips & Tricks #4: Zoho People - Mejoras y Novedades durante el Q2 de 2026

                                    ¡Hola, Comunidad de Zoho en Español! Os traemos una selección de las novedades y mejoras más interesantes que llegaron a Zoho People durante el segundo trimestre de 2026. En este artículo te hablamos de: Zia, el asistente de IA para RR. HH. OKR llega
                                  • You do not have sufficient permissions to perform this operation. Contact your administrator.

                                    When I attempt to log a call I initiate the +New Call and Start Calling and I click Answered Call in the popup dialog box that follows. Any attempt to save or close this dialog box results in "You do not have sufficient permissions to perform this operation. Contact your administrator." The only way I can get the popup to disappear is to refresh the page and it will go away. I have found others reporting this issue when they attempt to run reports.  Any suggestions? Thank you in advance for taking
                                  • More flexibility on Hosted Pages ?

                                    I like more flexibility on Hosted Pages, this is due to the fact I am not a programmer I wold like to have more customization on Hosted Pages like: - add Addons and coupon to a plan already suscribed in the past - cutomize the look an feel (as a form
                                  • Marketer's Space: Write CTAs your audience can't ignore

                                    Hello Marketers! Welcome back to Marketer's Space! Today we're zeroing in on a small concept that decides whether your whole campaign was worth sending: the call-to-action (CTA). You could write the sharpest subject line and design the most polished template
                                  • Button to renew offline subscription.

                                    If i have a customer who pays offline, and wants to renew the subscription, you have to wait till the end of the subscription and reactivate it. or else it affects metrics. There is a way to upgrade or downgrade a subscription, immedeatly or at the end
                                  • multiple Brands separate topic landing pages

                                    hii, i cant seem to figure out how to separate brands from the select topics marketing landingpage. i can only add topics for other brands, but i want to keep them complete separate
                                  • Public Forms for an all-inclusive feedback system

                                    The more we seek information from the customers, the more we solve their needs and gain their trust. However, reaching out to every customer to seek requirements, solve their issues, and gather feedback can be tasking. Circulating a public form helps
                                  • How to embed event list page from Backstage onto my site

                                    I'd like to embed the events list page from Zoho Backstage ( https://biz2bizlinksevents.zohobackstage.com/events) into my site, but when I use an iframe it says the page refused to connect. My other iframes with microsites from Zoho recruit and forms
                                  • Function #40: Notify users when invoices exceed the credit limit

                                    Hello everyone, and welcome back to our series! Businesses tend to offer goods or services on credit to customers, which can, in overtime, lead to the accumulation of significant overdue balances. To address this, Zoho Books allows you to define a Credit
                                  • Zoho CRM - Kiosk Studio: Build Once, Execute Multiple Times with Loops

                                    Hello Everyone, Introducing Loop Functionality in Kiosk Studio. If you've ever built a Kiosk that needed to perform the same action multiple times like updating a list of contacts, scheduling calls for a batch of leads, or processing multiple products
                                  • The 3.1 biggest problems with Kiosk right now

                                    I can see a lot of promise in Kiosk, but it currently has limited functionality that makes it a bit of an ugly duckling. It's great at some things, but woeful at others, meaning people must rely on multiple tools within CRM for their business processes.
                                  • Manual Journal not affecting the YE Trial Balance

                                    I have done a manual journal moving an expense from prior year to current year. However, it is not affecting the prior year figures at all, when I go to the expense the journal isn't even reflecting at all. I have made sure dates are correct and both
                                  • Tip #82 – Let Zia Answer Bot Handle the Questions So You Can Focus on the Fix – 'Insider Insights'

                                    Tip #82 – Let Zia Answer Bot Handle the Questions So You Can Focus on the Fix – 'Insider Insights' Hello Zoho Assist Community! Imagine you're in the middle of a critical remote session. The customer, a project manager at a mid-sized firm, has been locked
                                  • Caso de Éxito: Namencis Education crece un 117% con Zoho One

                                    "Hemos estado creciendo en torno a un 117% al año, que es una barbaridad. Tuvimos una rentabilidad del 33%, que antes no teníamos ni por asomo. Escalamos en tres años lo que no habíamos escalado en los anteriores siete." Borja Domínguez, CTO de Namencis
                                  • Introducing Workqueue: your all-in-one view to manage daily work

                                    Hello all, We’re excited to introduce a major productivity boost to your CRM experience: Workqueue, a dynamic, all-in-one workspace that brings every important sales activity, approval, and follow-up right to your fingertips. What is Workqueue? Sales
                                  • [IDEA] Bring Layout - Conditional Rules and Client Scripts to Zoho Books

                                    The problem We run Zoho Books with two e-invoicing integrations: myData (Greek tax authority, AADE) and PEPPOL (EU e-invoicing). Between the two, our Invoice form carries a large number of custom fields — document type codes, VAT exemption categories,
                                  • Introducing the Revamped Zoho Projects Chrome Extension

                                    Zoho Projects Chrome Extension brings your project management capabilities directly to your browser. Users can access all their portals, create tasks, file issues, log time, and stay updated on project activities without navigating to the main application.
                                  • Bigin Android app update: Alerts while creating tasks outside of working days, conflicting events and calls.

                                    Hello everyone! In the most recent version of the Bigin Android app, we have brought in support to display an alert if task is being scheduled outside of the working days. Also, when scheduling an event or call in the Activities module, a conflict alert
                                  • Create modules using natural language prompts

                                    Hello all, We’ve introduced a new enhancement to Zia that allows you to create custom and team modules in Zoho CRM using plain language prompts. Why this enhancement? Creating a custom module traditionally involves multiple steps—choosing field types,
                                  • Assign account to a ticket created with WebToCase

                                    We use Zoho Desk. Our large client uses WebToCase form to submit tickets. I have two workflow rules: When a contact is created and its email ends with example.com, it runs a custom function, which assigns the new contact the right account Example with
                                  • Collapsible Sections & Section Navigation Needed

                                    The flexibility of Zoho CRM has expanded greatly in the last few years, to the point that a leads module is now permissible to contain up to 350 fields. We don't use that many, but we are using 168 fields which are broken apart into 18 different sections.
                                  • Can the SEO Keyword field be increased from 100 characters to the industry standard 160 characters

                                    Hello, Currently Commerce restricts the SEO meta-keywords to 100 characters, which I'd always found to be a bit constraining, often times not enough space to suit my needs. I recently discovered however that search engines will accept up to 160 characters
                                  • Cookies Consent Management in Webforms

                                    Hello Everyone! We are excited to introduce Cookie Consent Management for webforms. Read on to learn more. Webforms are online forms embedded on websites that allow users to submit data and create records in Zoho CRM. These forms utilize cookies to track
                                  • Trigger workflows from SLA escalations in Zoho Desk?

                                    Hey everyone, I’m currently working with SLA escalation rules in Zoho Desk and ran into a limitation that I’m hoping someone here has solved more elegantly. As far as I can tell, SLA escalations only support fairly limited actions (like changing the ticket
                                  • Como exportar la base a excel sin perder datos

                                    Estimados quisiera saber como exportar o descargar la base de tickets para hacer estadisticas sin perder datos al copiar
                                  • Show my cost or profit while creating estimate

                                    Hi, While creating estimate it becomes very important to know exact profit or purchased price of the products at one side just for our reference so we can decide whether we can offer better disc or not .
                                  • Mise à jour de Zoho Books – France

                                    Chers clients, Merci pour votre patience et votre soutien continu. Avec les évolutions réglementaires à venir en France nous introduisons de nouvelles fonctionnalités dans Zoho Books pour les clients français. Ces mises à jour ont été conçues pour répondre
                                  • Is there any way to have Dataprep ingest RSS?

                                    As stated by the title. Does the Zoho environment offer tools that I can use to, directly or using workarounds, have Dataprep ingest an RSS feed? Thanks
                                  • Connect ZOHO social with Google Data Studio and download data from ZOHO social

                                    Dear ZOHO team, I am writing this message to enquire about how to connect ZOHO social with Google data studio since our company would like to use Google data studio to generate reports. Is it a way to download data from ZOHO social? Best regards, Chris
                                  • Zoho People Whats New - Q2 2026

                                    Hello Users! We're excited to share the latest updates introduced in Zoho People during Q2 2026. This release brings a range of new features and enhancements designed to simplify HR operations, automate routine processes, and deliver a smarter, more connected
                                  • Manage booking pages from your Android phone

                                    Hello everyone! We are happy to announce that users can now add and manage booking pages from their Bigin Android app. It is a multi-step form that users can create for purposes like booking appointments, scheduling calls or meetings, conducting webinars,
                                  • Zoho Team Inbox - roadmap

                                    Hi, would be good to understand the Teaminbox roadmap, in particular: 1. API / Zoho Deluge connections. We have a process where the each email needs to be either tagged or assigned daily. It would be great if we could automate a 5pm alert for any exemptions
                                  • Zoho CRM Community Digest - July 2026 | Part 1

                                    Hello everyone, July is here! The first two weeks brought six CRM updates ranging from privacy-ready webforms to a significantly more powerful Layout Rules engine, two community wins worth a look (a dashboard workaround for spotting leads with no activities,
                                  • How do I migrate from Office 365 to Zoho Mail?

                                    Check out Advik Email Migration Wizard, this software is specially developed to move mailboxes from Office 365 to Zoho Webmail. In addition you can migrate from Gmail, Yahoo, Rediffmail and 80+ webmail servers to ZOHO MAIL. Isn't it amazing? This is an all in one email migration solution. Steps to export emails from Office 365 to Zoho Webmail are as follows; Run Advik Email Migration Tool in your system. Select Office 365 as source and enter its login credentials. Select mailbox folders and choose
                                  • Topics not loading in individual contact records in Zoho Marketing Automation

                                    When working correctly, an individual contact record in ZMA shows a "Topics" section in the "Subscription" tab of the individual record. However, in 2+ different Zoho accounts and different browsers, the "Topics" section doesn't load and instead it spins
                                  • Help: Capture full page URL in hidden field when same Zoho Form is embedded on multiple pages (iframe)

                                    Hi all, Goal Use one Zoho Form across multiple pages and record the exact page URL (incl. subdomain + path + hash) where the user submitted it. Example pages: https://www.example.com/cargo/ https://www.example.com/cargo/containers/#contact https://cargo.example.com/auto/
                                  • Next Page