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
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
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
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 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
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?
Zoho Sheet for Desktop
Does Zoho plans to develop a Desktop version of Sheet that installs on the computer like was done with Writer?
Can I convert MSG to HTML on Mac?
Yes, you can convert MSG files to HTML on a Mac using software Aryson MSG file Converter. This tool allows you to convert Outlook MSG emails into multiple formats, including HTML, PDF, EML, PST, and more. It preserves all email content, attachments, metadata,
Duplicate Leads Notification Help!
Hello! I have several web forms that have a duplicate lead notification that are being sent to the creator of the web form. I understand how to change the form entry notification, but I am specifically looking to change the recipient of the "Duplicate Lead" notification. Any help you can offer is greatly appreciated! TIA, ~ Jenn
Adding Calendar Display to Home Page
I would like to display my calendar in a module on the Zoho CRM Home Page. I can't figure out a way to do this. Is it possible to display the CRM Calendar on the Home Page?
Schedule a Call by Date and Time when a specific lead status is selected
Hi Wanting to create a workflow where a call can be scheduled by date & time when a specific lead status is selected. Can only currently set the date by Due Date - Trigger Date - Plus 'x' day(s) Thanks
Incoming email replies not automatically associating with Deals/Opportunities - Is this possible in Zoho CRM?
Hello Zoho Community, I'm running a travel agency (B2B and B2C) and we've been struggling with what seems like a basic functionality that we cannot get to work properly. Our use case: We send emails to suppliers (hotels, transportation companies) and
Duplicate Leads Concerns with Round Robin and Lead Approval Process
It is great to have the Duplicate Lead Approval Process, there are a few issues with the process that I would greatly appreciate taken consideration in enhancing. It appears that A Lead comes in Lead owner assigned by the Round Robin Check for Duplicate,
Private email threads
When sending a Private email or receiving a response once the email thread has been marked as 'Private'- is there a way to trigger the system to "restart the clock"? I am finding that when someone responds to a 'Private' thread that it is opening the
SLA Notification
Team members have been receiving this notification and feel as though it is as random. Explanation on this notification is appreciated! Also, is there a way to disable this notification?
Map: Output None
Hi, Checking if you help me inspect this block The code below triggers during Successful form Submission from another Form. // rec_a = formA[ID!=0]; rec_b = formB[ID!=0]; ListA = List(); //subformA for each recA in rec_a.ItemSubform { for each recB in
Use arbitrary images in deluge
I am sending emails from my deluge code and I would like to be able to include a few images in the email template. While I know that I could put the on a website somewhere and link to them in the HTML, that is not what I want due to email client security
How to add "All Open AND Overdue" back to the Home Page Task Component?
Hi everyone, I’m looking for a way to restore the Tasks component dropdown list on the Zoho CRM Home Page. Since the recent update to the Task area in my Home Page Classic View, the dropdown options (e.g., My Next 7 Days + Overdue) are too restrictive
Sync Attachments in Comments from Zoho Desk to Zoho Projects
Hello Zoho Desk Team, We hope you're doing well. We are actively using the Zoho Desk–Zoho Projects integration, especially for reporting and managing bugs/issues between support and development teams. Current Limitation: After creating a bugs/issues via
Add a way to connect Log360 Cloud logs with Zoho analytics
Hi, Several month ago Log360 Cloud was added to zoho one - and this is great. But as far as I see there is no prebuilt way to connect Zoho analytics to the logs we have in Log360 Cloud. Please add a prebuilt connection like we have for so many other zoho
Auto sync Photo storage
Hello I am new to Zoho Workdrive and was wondering if the is a way of automatically syncing photos on my Android phone to my workdrive as want to move away from Google? Thanks
Funcionalidades y configuration ZohoDesk
Creo que no estoy sacando el provecho adecuado a la application quisiera solicitar una capacitación al respecto
How to call Functions and perform Write Operations using Page Scripts?
Hi everyone, How to call a function from a Zoho Creator application within a Page Script, also how to perform write operations (adding or updating records) using page scripts?
Connecting Airwallex in Zoho Books
I have a question. I’m trying to connect our Airwallex account to Zoho Books, but the integration does not seem to work. Could you please guide me on how to properly connect Airwallex? I need to see the expenses also, since it only shows the profits now
Questions Regarding Helpdesk & SalesIQ Customization and Email Setup
Hello, I hope you’re doing well. I have a few questions regarding Helpdesk and SalesIQ: Can the emails sent to customers via helpdesk tickets be fully customized — including signature, subject line, and other elements? Also, is it possible to send these
Button Duplication when emails forwarded or replied
When I create a new email template in campaigns and send it out it looks fine to all the users, however if that email is then on forwarded or replied to then all buttons within the email duplicate. See below The one on the left is the original one.
Workdrive backup and default storage selection
Hi community, I have been informed by Zoho that workdrive will be the default storage mechanism for crm and projects. These 2 Apps seem to have different design on how they interact with workdrive for storage. 1. Crm: seems to have files saves at the
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
Ask the Experts 27: Onboarding and managing support reps
Hello everyone, We are back with our Ask the Experts (ATE) series for 2026. This year, we bring experts to help you address customer support challenges using Zoho Desk. For our first ATE, we are getting into the human side of customer support. "Every
CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive
Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
Assign emails to lead
I have some contacts who refers leads but there is no away to manually assign emails to lead.
sync two zoho crm
Hello everyone. Is it possible to sync 2 zoho crm? what would be the easiest way? I am thinking of Flow. I have a Custom Module that I would like to share with my client. We both use zoho crm. Regards.
Built-in Date Functions in Zoho Analytics Query Tables
I have a doubt about whether Zoho Analytics Query Tables provide built-in functions for start date, end date, and the current month
Introducing Rollup summary in Zoho CRM
------------------------------------------Moderated on 5th July'23---------------------------------------------- Rollup summary is now available for all organizations in all the DCs. Hello All, We hope you're well! We're here with an exciting update that
Next Page