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


    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

                                                                                                                    • Is there provision to charge the attendees to join the webinar?

                                                                                                                      We want to host some webinar of public interest and want to charge them to participate in this. Does this feature in-build in the application? Offcourse, we will be having Razor pay account activated for these purpose.
                                                                                                                    • Pricelists

                                                                                                                      So we have them in books but I cannot find them in commerce?
                                                                                                                    • Desktop app doesn't support notecards created on Android

                                                                                                                      Hi, Does anybody have same problem? Some of last notecards created on Android app (v. 6.6) doesn't show in desktop app (v. 3.5.5). I see these note cards but whith they appear with exclamation mark in yellow triangle (see screenshot) and when I try to
                                                                                                                    • Don't send customer email when creating a ticket

                                                                                                                      Hi Is there an easy way to stop the system sending an email to the customer when we manually create ticket.
                                                                                                                    • List of Mail Merge Templates via Deluge

                                                                                                                      Hello, Is it possible to get a list of the mail merge templates I've created in CRM within a custom function? I want to retrieve them and put them in a dropdown list but all I get is a scopes error! Can anyone see where I'm going wrong? Is this even possible?
                                                                                                                    • Feature Request Improve parent-child relationship visibility

                                                                                                                      Hi team, The Parent-Child ticket feature is great, but I've struggled to see the relationship between tickets when using ticket list views. It would be a great quality of life enhancement for users if child tickets were nested under parent tickets in
                                                                                                                    • Introducing Bulk Attachment Download from List View

                                                                                                                      We're excited to introduce an update to attachment management in Zoho Recruit that lets you download attachments associated with selected records directly from the List View page of any module. How do I download attachments in bulk? You can now select
                                                                                                                    • 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).
                                                                                                                    • Tiktok

                                                                                                                      When will Tiktok be added to the Zoho Social Platform?
                                                                                                                    • Zoho Mail iOS app update: Spam Controls & Sender Verification

                                                                                                                      Hello everyone! We are excited to introduce spam control enhancements in the Zoho Mail iOS app update. Let's dive into what's new. Spam Alerts in Mail Preview : Mail preview now shows warning alerts for emails identified as potentially harmful, helping
                                                                                                                    • 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
                                                                                                                    • Admin Logging in as another User

                                                                                                                      How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
                                                                                                                    • Zoho Books API: Bulk update thousands of records using Node.js with OAuth refresh, retries and resume support

                                                                                                                      Hello everyone, During Zoho Books implementations, one common challenge is updating a large number of existing records. The current options are usually: Update records manually from the UI using Mass Update (with limited batch size). Update records one
                                                                                                                    • SalesIQ's Summer '26 Release: For The Moments That Matter

                                                                                                                      Every customer journey is made up of moments. The moment someone discovers your business. The moment they need help. The moment you decide to reach out. The moment a simple chat turns into something more. And the moments that continue long after the conversation
                                                                                                                    • CNIL - Suivi de Pixel

                                                                                                                      Bonjour à tous, À la suite de la nouvelle recommandation de la CNIL sur les pixels de suivi dans les e-mails, savez-vous si Zoho Campaigns permet : de conditionner le suivi des ouvertures au consentement de chaque contact ; de proposer un lien permettant
                                                                                                                    • Customer/Vendor Portal session duration - can it be extended?

                                                                                                                      Hi all, We'd like to know how long the login session lasts for the Customer/Vendor Portal in Zoho Books, and whether there's any way to extend it (either through settings or via support/API). Right now this is causing a pretty poor experience for our
                                                                                                                    • Accessible & Customizable User Governance in Zoho Projects!

                                                                                                                      As teams expand and collaborate with multiple external collaborators across projects, keeping control of user access to project data becomes a challenge. Mismanaged access can cause accidental or unauthorized edits, data leaks and lack of accountability.
                                                                                                                    • Bulk deleting Zoho CRM records using Deluge, COQL and CRM API

                                                                                                                      Hello everyone, During CRM implementations, data cleanup is a common task, especially after testing, migrations, imports, or integration development. The Zoho CRM UI allows deleting records in batches of 100, which is not practical when dealing with thousands
                                                                                                                    • CNIL - Suivi de Pixel

                                                                                                                      Bonjour à tous, À la suite de la nouvelle recommandation de la CNIL sur les pixels de suivi dans les e-mails, savez-vous si Zoho Campaigns permet : de conditionner le suivi des ouvertures au consentement de chaque contact ; de proposer un lien permettant
                                                                                                                    • Zoho CRM Layout Rules: Nine New Actions, Profile-Based Execution, and Interactive Preview

                                                                                                                      Hello everyone, Availability: This feature is now available for customers in the JP and SA DCs. It is planned to be released for other customers in soon. We’re excited to announce powerful new enhancements to Layout Rules in Zoho CRM - a feature built
                                                                                                                    • Automatically set the default VAT percentage on a quote

                                                                                                                      Every time I create a quote, I have to manually adjust the VAT and activate the checkbox for 21%. But all of our quotes include 21% VAT. So now occasionally, it happens that the checkbox is forgotten, and the customer receives an incorrect quote (without
                                                                                                                    • How to View Part Inventory and Warehouse Location When Creating a Work Order in Zoho FSM

                                                                                                                      Hi everyone, We’re currently setting up Zoho FSM and would like to improve how our team selects parts when creating a Work Order. Right now, when we add a part or item to a Work Order, we can select it from our Zoho Inventory list but we don’t see any
                                                                                                                    • Zoho Sprints - Q2 Updates for 2026

                                                                                                                      Improve your agile project management experience with the newly released capabilities in Zoho Sprints. This quarter we've shipped a few new features and enhancements that are built around smarter planning and execution tools, tighter integrations, and
                                                                                                                    • Building extensions #5: Creating custom user interfaces using widgets

                                                                                                                      In our last post, we looked at connections and how they help build a seamless integration with an example. In this post, we'll explore creating widgets in Zoho Sprints and their benefits with a real-time example. Widgets What and where? Widgets are custom
                                                                                                                    • Images not saved in notes

                                                                                                                      Created noteboards and create a note, copy pasted the image, close the note and open again, image is not coming this same problem occurs in note on notebook I have attached the replication steps as video url to analyse it, and also attached the videos
                                                                                                                    • How to Change Notecard Color After It Is Created

                                                                                                                      I would like to change the color of a Notecard that already exists in my notebook. I can't for the life of me figure out how to do it. I don't see an option or color picker anywhere.
                                                                                                                    • Cannot export Zoho Notebook data nor search via MCP (GDPR)

                                                                                                                      Hi, I'm using Zoho Notebook for a few years now. Not as my main notetaking app, but for specific usecases I did find it handy. Now I want to export all my data. Preferably all notes in html format with metadata like note title, included images and parent
                                                                                                                    • Bring more clarity to your blueprints with color-coded transitions

                                                                                                                      As your hiring processes evolve, blueprints naturally become more detailed. When multiple transitions connect different stages, it can take extra effort to identify approvals, rejections, reviews, and other actions at a glance. With this enhancement,
                                                                                                                    • Add a MATRIX field to the forms creation

                                                                                                                      Same as Zoho forms, we need a Matrix field in Zoho Creator forms, is very usefull
                                                                                                                    • incoming mails not received

                                                                                                                      incoming mails not received
                                                                                                                    • Integrate QuickBooks with Bigin and streamline your sales and accounting!

                                                                                                                      If your business relies on Bigin for customer management and QuickBooks for accounting and invoicing, this new integration is here to make your operations more efficient. By connecting these two platforms, you can now manage your CRM and financial processes
                                                                                                                    • Automatically calculate and include tax on quotes

                                                                                                                      I've recently been VAT registered and now need to include VAT on my quotes. I have been able to set the tax label and amount but still need to click the tax link and select the tax I wish to include before it appears on the quote. Does anyone know of
                                                                                                                    • Relative Dates

                                                                                                                      Is there a way to apply a Relative Date filter in DataPrep (ie. Today or Yesterday)? I need to filter a dataset to only include rows with a created date of yesterday, but I’m not finding a way to do it?
                                                                                                                    • Change email addresses - Advise how

                                                                                                                      Good day, I need assistance to change all our users email addresses Please advise
                                                                                                                    • email signature

                                                                                                                      How do you add an email signature
                                                                                                                    • Email Forwarding | How to Enable and Disable Email Forwarding on a Non-Admin User Account

                                                                                                                      Email Forwarding Issue: Enable and Disable Email Forwarding
                                                                                                                    • Ask the Experts 31: Improving support performance with reports and dashboards

                                                                                                                      Hello everyone, Join us for the next Ask the Experts (ATE) session! Ask the Experts is an opportunity to connect with people who have deep knowledge of Zoho Desk. Let's look at the topic we're focusing on this month. Just as we rely on the right tools
                                                                                                                    • Zia AI capabilities now available in all paid editions

                                                                                                                      Hello everyone, We are expanding the availability of AI-powered features in Desk to the other paid subscriptions from 7th July 2026. Right now, the following AI-based features are available for Enterprise edition users: Intelligence: Sentiment analysis,
                                                                                                                    • Product updates in Zoho Workplace applications | June 2026

                                                                                                                      Hello Workplace Community, Let’s take a look at the new features and enhancements that went live across all Workplace applications for the month of June. Zoho Mail Alphanumeric support for attachment extensions in rule conditions Attachment extension
                                                                                                                    • Biggest supported size of a note

                                                                                                                      I'm still testing this ZOho Notebook before purchasing a premium licence and can't work with large notes. I store personal vocabulary in two 13,000-word / 83200-character notes. Same poor experience with PC, Web, and mobile apps: Is there an application
                                                                                                                    • Next Page