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


    • 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
    • Recent Topics

    • LAST YEARS TRANSACTIONS

      How do I obtain a statement for transactions from last year - 2025
    • Missing Company Name on Estimate

      Hi there, I noticed that On some of my estimates (either new or old) the Company name disappeared and not shown neither on Zoho Book Client page nor on the estimate. Please note that on the PDF generated months ago, the estimate contains the company name.
    • Não estou recebendo código de autenticação (Instagram)

      Olá, utilizei uma das minhas contas de email Zoho para criar um cadastro no Instagram, o email com o código de autenticação de confirmação da conta não chega no meu email Zoho (nem.ma caixa de spam, nem na lixeira, e nem em outras pastas). . Já solicitei
    • Automation #7 - Auto-update Email Content to a Ticket

      This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk. Email is one of the most commonly
    • Recurring Invoices not generating – "Next Invoice Date" has passed despite "Active" status

      Hi everyone, We are currently experiencing an issue in Zoho Books where our recurring invoice profiles are not generating invoices/drafts as scheduled. The Problem: As shown in the attached screenshot, the "Next Invoice Date" (Nächstes Rechnungsdatum)
    • #3 Stop Retyping the Same Things

      Imagine a store where customers keep walking in and placing different orders throughout the day. The store owner manually enters every product name, price, tax and description while creating invoices. During a busy day at work, the store owner had to
    • Rename system-defined labels in Zoho CRM

      Renaming system-defined labels is now available across all DCs. Hello everyone, Zoho CRM includes predefined system fields across modules to support essential CRM operations. Until now, the labels of these fields were fixed and could not be edited from
    • Creator List not showing

      I've edited a list in creator, but when I open it in the live version the list is completely different. Anyone know why this is happening? Edit Version: Live Version:
    • Mirror Component in Zoho CRM: Access real-time related data without leaving your record

      Hi everyone, This feature is now available for the JP, CA, SA, UAE, and AU DCs. We're excited to bring to you Zoho CRM's mirror component, which presents relevant data on a record's details page and keeps everything users need in one place without having
    • Functionality based URL to find records due today or in the next week

      I need to construct a URL to filter a view to records where the evaluation is due soon (i.e. in the next 7 days). To me, that includes today, but Zoho has a different opinion. Zoho defines 39 as NEXT_7_DAYS but this gives unexpected results. https://creatorapp.zoho.eu/...#Report:My_Evaluations?Evaluation_due_by_op=39
    • Automated entries past the current month in a calendar report

      Hi all, I have an automation problem. I have a form which on successfull entry adds either 5 or 10 more of these entries with a slight change so our customers can see it throug a calendar report on the webiste. The entry put in manually shows up perfectly
    • Problem: New Email Consistently Failing to Sync/Display in Inbox

      Recently, I have noticed that my Zoho Email inbox does not indicate I've received a new email, until I go to *another* folder and then return to the inbox. Only then will new emails be displayed. This has happened 100% of the time, during the past few
    • Upcoming Webinar: Landing page optimization strategies you need in 2026

      If users are visiting your landing page but not converting, your page is trying to tell you something. The key is knowing what to optimize. Sometimes a landing page doesn’t need a complete redesign. A better CTA, fewer form fields, clearer messaging,
    • Nueva edición de Meetups de Español Zoho Community - Junio 2026

      ¡Vuelven los Meetups de Español Zoho Community a España! ¿Te gustaría convertir más visitas y clics a tu página web en clientes de tu empresa? Esto es muy sencillo gracias a las soluciones de software de Zoho, como bien sabéis. Y es por ello que estamos
    • How to make the birthday date field available without the year?

      Hello, I wonder if I can have the date of birthday field without the year. A lot of people dont like to say the year they were born. 
    • Marketing Tip #33: Build trust with behind-the-scenes content

      Customers are more likely to trust a brand when they can see the people, process, and care behind it. Behind-the-scenes content adds that human layer to your business. It shows that there’s a real team behind the store packing orders, checking quality,
    • Marketing Tip #9: Track your traffic sources

      Not all marketing channels work equally well. Knowing whether your visitors come from Google, Instagram, or email helps you focus on what actually drives sales. Try this today: Check your Zoho Commerce reports or connect Zoho PageSense to see your top
    • Remove ####,####.## Placeholder from Number & Decimal Fields in Zoho Creator

      Just wanted to share a small UI workaround I used in Zoho Creator. By default, Number and Decimal fields show placeholders like: ####,####.## Sometimes this doesn’t look clean, especially for read-only calculated fields in custom UI designs. I was able
    • Default ticket template in helpcenter

      Hello, I have a web form and a ticket template created. How can I make that my default ticket template? If an user clicks New ticket or create a ticket, I want that template to be the default one. Thank you for the time and info.
    • Whatsapp Limitation Questions

      Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
    • Adding a custom formula field from sub-forms

      I have used my 5 Aggregated Sum fields in the subform. I have another column I want to add a summary of. This can be in a separate section/field. The formula field won't pull in information from the sub-form. How do I pull information from the sub-form
    • Custom Buttons & Links Now Supported in Portals

      We’ve just made portals in Zoho Recruit more powerful and customizable than ever! You can now bring the power of Custom Buttons and Links to your Candidate, Client, Vendor, and Custom Portals, enabling portal users to take direct action without recruiter
    • Mastering Zia Match Scores | Let's Talk Recruit

      Feeling overwhelmed by hundreds of resumes for every job? You’re not alone! Welcome back to Let’s Talk Recruit, where we break down Zoho Recruit’s features and hiring best practices into simple, actionable insights for recruiters. Imagine having an assistant
    • New feature: Usage dashboard in Zoho Sign

      Hello! Zoho Sign's new usage dashboard lets organization administrators monitor product adoption across teams, identify unused plan features, and view the environmental impact of every envelope. The dashboard includes six panels: Envelopes sent, Feature
    • Introducing the New Zoho Assist Quick Support Plugin

      We are thrilled to announce the new Zoho Assist Quick Support Plugin, the upgraded and enhanced version of the Zoho Assist Customer Plugin. This new plugin allows organizations and IT administrators to deploy it directly onto their customers’ devices,
    • Account Reconciliation via API

      I am suggesting that the Zoho Books team considers making it possible to do an Account Reconciliation via API. The use case I have in mind is specific, but also fairly common: merchant services clearing accounts. Currently, the only way to reconcile an
    • Edit a previous reconciliation

      I realized that during my March bank reconciliation, I chose the wrong check to reconcile (they were for the same amount on the same date, I just chose the wrong check to reconcile). So now, the incorrect check is showing as un-reconciled. Is there any way I can edit a previous reconciliation (this is 7 months ago) so I can adjust the check that was reconciled? The amounts are exactly the same and it won't change my ending balance.
    • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

      Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
    • When will Zoho Trident come to Linux?

      It already is implemented for MacOS, which is *nix based operating system. When will it be ported to Linux?
    • 普段使っているAI、Zohoと繋げてもっと便利にしませんか?【Zoho MCP】

      みなさんこんにちは、ゾーホージャパンの岸本です。 ChatGPTなどのAI、普段から使っていますか? 最近は「AIを使う」だけでなく、 普段利用している業務ツールとAIを繋げて活用するケースが増えてきています。 そこで6月のコミュニティイベントでは、Zoho社員セッションでZoho MCPを取り上げようと思います。 【Zoho MCPって?】 Zoho MCPは、AIとSaaSアプリケーションを連携するための仕組みです。 ----------- MCPプロトコルをサポートしているLLM(一例):
    • Zoho Commerce and Third-party shipping (MachShip) API integration

      We are implementing a third-party shipping (MachShip) API integration for our Zoho Commerce store and have made significant progress. However, we need guidance on a specific technical challenge. Current Challenge: We need to get the customer input to
    • Need help to evaluate if Commerce is good for me

      Hi, I just want to quickly check if Zoho Commerce can fulfill my needs. Here is what I am looking for: - Multi-vendor plateform : We will be 3-4 different farms that will offer similar products (ex. tomatoes) to few selected customers (retaurants). All
    • Zoho Commerce + MCP + Claude

      Hi everyone, I wanted to share a really impressive experience I had with Zoho Commerce + MCP + Claude. I created an MCP server using Zoho MCP Server and connected my Claude instance to my store built with Zoho Commerce. For safety, I enabled only product
    • UK payroll entries

      Hey guys, Nett payroll payments are imported direct into the bank, using an external payroll system (will be glad for Zoho to have a UK payroll app) At present I have monthly recurring bills for HMRC which are auto entered & paid when due. This seems
    • auto add as member the contact owner

      is there a way that i can make a zoho flow that will add the owner of the contact as a member of the chat after the round robin assignment?
    • Get Files Associated to Data Template via API

      I have a data template with multiple files associated to it, and trying to write a Deluge script that will fetch files associated with this data template. I created the script below based on the WorkDrive API documentation, one request uses the data templates
    • Zoho Book - Banking Module - Cash Credit account

      I have a CC account with a bank. I initially added the account as a 'Bank Account' under the banking module in Zoho Books. However, this CC Bank Account is showing as an asset instead of a liability. I have added the account as a credit card account but
    • How to change column headings in pivot table?

      Hi, Is there a way to rename the column headers of a pivot table? Now some the columns are named with value labels: 'SUM of .....'. We would like to rename those headers. As of now we couldn't find any direct solution to adjust the headers, besides copying and reformat. We want to avoid these extra steps. Best, Tiemen
    • Remove Zoho Header from Portals

      I have a portal page with custom domain. But when I print directly from a webpage, the Zoho CRM header shows. It kind of kills the branding aspect. Is there a way to get rid of this?
    • Leistungsdatum in Rechnungen (Zoho Books)

      Hallo, ist es irgendwie möglich den Leistungszeitraum in der Rechnung aufzuführen? Beste Grüße Aleks
    • Next Page