This is my on Load client script that I use for Create pages. I use a modified version for Edit and Display pages which you can create yourself using the same basic structure that I will give you below. First up, the script. Below that will be an explanation of how it works.
- const subformAPINames = ['Deal_Quotes', 'Assets']; // Declare all your visible subform API names
- const formAPINames = Object.keys(ZDK.Page.getForm().getValues()); // Get all API names visible on the page
- const fieldAPINames = formAPINames.filter(x => !subformAPINames.includes(x)); // Remove the Subform API names from the array above, creating an array of field API names.
- const visibleFields = [
- "Account_Name", "Closing_Date", "Contact_Name", "Current_Task", "Customer_Reference",
- "Deal_Name", "Description",
- "Expected_Conversion", "Info_Required",
- "Next_Project_Follow_Up", "Opened_Date",
- "Product_Range", "Source", "Stage", "Type_2",'CCL','Asset'
- ];
- const readOnlyFields = ['Last_Follow_Up','Next_Project_Follow_Up','Opened_Date','Deal_Name','Current_Task','Stage']; // Declare all fields required to be read only on page load
- const mandatoryFields = ['Account_Name','Type_2','Product_Range','Description']; // Declare all fields required to be mandatory
- fieldAPINames.forEach(f => { if (!visibleFields.includes(f)) { ZDK.Page.getField(f).setVisibility(false); } }); // Hides all fields except subforms
- readOnlyFields.forEach(f => { if (fieldAPINames.includes(f)) { ZDK.Page.getField(f).setReadOnly(true) } }); // Sets all read only fields as such
- mandatoryFields.forEach(f => { if (fieldAPINames.includes(f)) { ZDK.Page.getField(f).setMandatory(true) } }); // Sets all read onlymandatory fields as such
- subformAPINames.forEach(s => (Object.keys(ZDK.Page.getSubform(s).getRow(0).getValues()).forEach(f => ZDK.Page.getSubform(s).getField(f).setVisibility(false)))); // Hides all subform fields
So, how does this work?
This script works with all profiles with all field permissions. You don't need to worry about creating separate scripts or separate blocks for different profiles.
- First we declare all the subform API names in the module
- Next, we grab all the API names visible to the logged in user on page Load.
- This doesn't distinguish the type of field, which is why we need to declare the subform API names manually
- Now we remove the subform field API names from step 2. This gives us 2 lists, or arrays. 1 array with just field API Names, and 1 array with just subform API Names.
- Next, we're going to have 3 arrays. Visible Fields, Mandatory Fields, Read Only Fields. Within these arrays, we're going to list ALL the fields that we want in each category
- Again, it doesn't matter if the logged in user has access to the field or not.
- Now, the loops begin:
- For each field in the fieldAPINames array, if the field name is NOT in the list of visible fields, hide it.
- For each field in Mandatory fields, if the field name IS found in the fieldAPINames array, make it mandatory
- For each field in the Read Only Array, if the field name IS found in the fieldAPINames array, make it read only
- Before we go on to the subforms, the above loops only work on the list of fields available to the user. If we were to make a field "Profit" read only, but it's not available to the particular user, "Profit" won't be in fieldAPINames, therefore the script won't try to make it read only... the script doesn't know "Profit" exists.
- If we were to use ZDK.Page.getField("Profit").setvisibility(false) and the user does not have access to the field, the script would fail. This script is completely immune to such a situation.
- Next, the subforms. We don't actually get the subform field names when we get all field API names. We get the subform API name, but not the individual subform field API Names. However, each subform is always populated with 1 row, even if that row is completely empty, it doesn't matter.
- The last line cycles through each subform. If the subform was found on the page, it executes the next nested loop.
- For each visible subform, we get the first row and strip out all the field API names.
- Now we have the subform field API names, we hide all the ones we don't want visible. In my case, I don't want any subform fields visible yet, so I just hide all of them
And that's it. One final note. I specify the visible fields rather than the hidden fields since there's usually less visible fields, so it makes sense to focus on the shorter list of fields that should be visible rather than the list of fields that should be hidden. It also means that any new fields are automatically hidden without having to alter the script.
In my next post, I will share my script structure of an On Page Change event.
Recent Topics
Newby Questions
Q1. The top bar of Zoho Books has a "Search in Banking (/) " field. What is the proper use of this text box? - Searching for Amazon for example has no results but there are transactions. - Is the search case sensitive? - Are regular expressions allowed?
Transaction Rule Matching
Q1. Is there a method to have the Transaction Rules applied across multiple Bank Accounts? Q2. To match "contains" text in Transaction Rules, is a wildcard or regular expression required? Is it case sensitive? Would searching for "issue" in the following
Newby Questions - Vendors, Customers, and Income vs. Other Income Clarifications
Q1. For Deposits, there does not seem to be an option for "Income". "Other Income" is an option however. What is the process to add the option to assign a deposit to type "Income"? Q2. In many cases Vendors and Customer are the same. Vendors may purchase
Introducing parent-child ticketing in Zoho Desk [Early access]
Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
Three Zoho Billing Limitations Blocking Standard Subscription Operations
After working through Zoho Billing support for over a year on these three issues without resolution, we wanted to flag them to the broader community. We are curious whether other businesses are running into the same walls. 1. Cannot Prepone (Move Earlier)
Automation #3 - Auto-sync email attachments to tickets
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. Most of our customers use email
Can't add a sender adress from zoho campaigns
hi, I need to change the sender address for a campaign. When i try to add it i get a message to say 'duplicated email address found while adding your sender address'. This is the first campaign i'm sending so I don't understand why this message is displayed? Thanks Jane
Using a custom single line External ID form as merge fields in templates
Hey everyone, We're looking to integrate a few external systems better with our Zoho CRM, and we had hoped to use external fields for this purpose. In this case, it would mean being able to use our own inoice system's invoice numbers are a direct id compatible
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
Zoho CRM - Feature Request - Analytics Components Group By Week Alternative Formats
On the Zoho CRM Analytics Components, please consider adding an option to allow group by week format to be changed to other formats such as Week Commencing or Week Ending dates, rather than the current Week Number. This would provide improved usability
Dashboard target enhancements
Often individuals in IT are creating dashboards for their sales team. The ability to create a single dashboard that can be used by multiple people is key. A components for a dashboard have the ability to filter by logged in user which is great. However
Zoho Campaigns - Feature Request - Re-Send Existing Email Action in Automations/Journeys
Hi Zoho Campaigns and Zoho Marketing Automation teams, I would like to suggest a feature that would make building and managing complex automations significantly easier. The Feature Introduce a “Re-Send” or “Send Existing Email” action within Automations
Can I write a check in Zoho Books with no associated bill?
This currently does not seem possible, and I have a client that desperately needs this function if I am able to convert them with Quickbooks. Thank you in advance for your reply.
ISO 3166-2 Compliant Country and Regions
Zoho should consider implementing ISO 3166-2 standards for countries and regions in address dropdowns. It adds a lot of noise in the data when items added programmatically conform to ISO 3166-2 (e.g., TX for Texas, CA for Canada, etc.), but the few items
US State abbreviations in Address fields
In regards to all Address fields within Zoho, Is there a way to change the State field to be the 2 letter abbreviation vs the full spelled out US State name? Example: "Washington" should be WA. I am able to type in the abbreviated state, but it's not
Zoho Booking - TIN vs ATIN & ITIN
Zoho Booking Vendors allows for TAX ID values of SSN, EIN, ATIN an ITIN. There is no option for TIN. What is the method to properly add TIN to the list of taxable values for companies? For reference: Social Security Numbers (SSN) Individual Taxpayer Identification
How to see Statement Details Shown in Unclassified Transactions in All Transactions?
All, The list of Unclassified Transactions show the Statement Details and Descriptions. What is the method to see that column in the All Transactions list? -Thanks!
Add Reauthentication Option for Zoho Bug Tracker Integration in Zoho Desk
Hello Zoho Desk Team, We hope you're doing well. We would like to request an enhancement to the Zoho Bug Tracker integration within Zoho Desk. Current Limitation: At the moment, there is no option to reauthenticate the Zoho Bug Tracker integration in
Zoho Books | Product updates | October 2025
Hello users, We’ve rolled out new features and enhancements in Zoho Books. From iOS 26 updates to viewing reports as charts, explore the updates designed to enhance your bookkeeping experience. Zoho Books Updates for Apple Devices At WWDC 2025, Apple
Bill sent for Payment Approval
Zoho Books currently supports three levels of transaction approval for bills: Draft, Submit, and Approved. We are looking to add a layer of approval like a bill marked for payment before initiating payment requests through HSBC Bank. Can you please guide
Ask the Experts - Live Q&A webinar
Hello Community, We’re excited to host our very first Ask the Experts session! Join us on 7 April 2026 from 11 a.m. to 12 p.m. (IST) for this live webinar Q&A session, where you will have an opportunity to connect directly with our product experts, gain
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
Kaizen #235 - Automating record restoration using Recycle Bin APIs in Zoho CRM
Welcome to another Kaizen week. Here's a question that came up in our developer forum: "I'm working on a piece of software to automate conversion of Leads into Deals based on order status from my company's website. There are some cases where a previously
Open PDFs using Zoho PDF Editor
Hello users, In this article, we will be exploring the open PDF capability in Zoho PDF Editor to collaboratively edit PDFs, insert text and images, add fillable and e-signature fields, and more. You can upload PDFs upto 50 MB or 150 pages. Password-protected
One Contact with Multiple Accounts with Portal enabled
I have a contact that manages different accounts, so he needs to see the invoices of all the companies he manage in Portal but I found it not possible.. any idea? I tried to set different customers with the same email contact with the portal enabled and
Bank Feeds Breaking Constantly
Hey Everyone, I have already reached out to support about this issue but I am wondering if anyone else is having the same issue. My bank feeds keep breaking within days of me fixing them by updating the credentials. Its been happening for a while and
Print Sales Orders, Purchase Orders or Invoices from API
Hello, Is it possible to use the print option that is available in Sales Orders Purchase Orders and Invoices with the API?. I don't see any information in the docs about this. Thanks
Timed addition to segments
Hi there - hoping you can help me figure out a graceful way of doing this: • I want to add contacts to a Segment in Campaigns based on a Stage pick-list field value X in CRM - that bit's fine. The problem is that I only want to add them to the Segment
Zoho Developer AI Agent = Claude AI + MCP Server + Zoho Ecosystem
Hello Zoho Community 👋 I’m excited to share a recent integration we’ve worked on at Officehub Tech: ✅Claude + MCP Server + Zoho Creator Zoho Developer AI Agent – an AI-powered Zoho automation platform This solution connects Zoho applications with an
Dynamic Questions in Zoho Forms
Is it possible to add dynamic questions (like displaying a user’s name) in Zoho Forms? I know this is possible in surveys, but can we implement similar functionality in Zoho Forms?
Cliq iOS can't see shared screen
Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
Google Fonts Integration in Pagesense Popup Editor
Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to enhance Zoho Pagesense’s popup editor with Google Fonts support. Current Limitation: Currently, Pagesense offers a limited set of default fonts. Google Fonts
CRM
How do I build an email funnel of 10 emails with decision tree ie; if yes use this email if no use this email. Also I cannot figure out how to add more groups or see my whole groups. I've set up different groups like attorneys is one group of companies/people
WebDAV support
I need WebDAV support so that I can upload/download (and modify) documents from my local file system. Is anything planned in his direction?
Replying from same domain as a catch-all?
I have 2 domains setup on Zoho, both with associated email addresses. They look something like this: john@example.com (primary address) john@test.com (this domain also has a catch-all setup) I use the catch-all for test.com as a public-facing email address
Is there a way to show contact emails in the Account?
I know I can see the emails I have sent and received on a Contact detail view, but I want to be able to see all the emails that have been sent and received between all an Accounts Contacts on the Account Detail view. That way when I see the Account detail
Internal Fillable Contract with Zoho Writer (Before Sending to Client)
Hi everyone, I’m trying to automate the following process in Zoho CRM and would appreciate some guidance. Process: When a Deal moves to a specific stage, CRM triggers an automation. CRM sends a contract template to an internal team member so they can
Standard practice rerun updated deluge function over existing recordes
Hi folks, we have a function which is triggered via webhook from a third-party solution which then calls another api with a contact-id and gets a json payload back and then parses that data to custom fields in our CRM to the record id. As requirements
can change deal colors in bigin?
can be super useful if we can change colors deals process any way to do it?
Import Quote from CRM into document in Writer?
Hi, I created a quote for a proposal in the Zoho CRM and was wondering if there is a way to embed the quote into a document in Zoho Writer so I can make our sales proposals look a little nicer. Is that possible?
Next Page