Kaizen #198: Using Client Script for Custom Validation in Blueprint

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. 
Hello everyone!

Welcome back to another exciting Kaizen post. Today, we will explore how to use Client Script to handle a use case in Blueprint beyond Zoho CRM’s native features. This will solve the use case raised in this community post.

Quote
"At Zylker, the Admin wants to proceed with a Blueprint transition only if at least one of the four fields is filled during the transition "Gather Details" . However, Blueprints only allow fields to be marked as either mandatory or optional. There's no built-in way to enforce a rule like at least one required.The use case is to add a custom validation that allows the transition only if any one of these fields in the mandatory fields form is filled."

In this post,


  • Need for custom validations in Blueprint
  • Client Script Events related to Blueprint
  • Use Case
  • Solution
  • When to use this event?
  • Summary
  • Related Links



1. Need for custom validations in Blueprint

In Zoho CRM, Blueprint allows administrators to streamline and guide users through structured processes by defining states, transitions, and mandatory fields at each step. While Blueprints support marking fields as mandatory or optional during transitions, they do not support conditional logic like at least one of these fields must be filled, making a field mandatory based on another field’s value, validating date ranges, etc.

To accomplish such requirements, you can use Client Script.

2. Client Script Events related to Blueprint

The following Client Script events can be used in Blueprint.

  • beforeTransition - This event occurs before the transition states of a Blueprint, as per the process flow designed in the blueprint. Click here to know how to use this event.
  • onBeforeMandatoryFormSave - This event occurs when the user clicks the save button of the mandatory fields form, but before saving the values.
  • You can use this event to validate the data entered by the user and stop proceeding further.
  • onMandatoryFormLoad - This event occurs when the mandatory fields form appears on the screen. If you want to show a message or accomplish any custom action when the mandatory fields form loads, you can use this event.

Click here to see the related Events documentation. These events can be configured in both Standard and Canvas Detail Pages.


Notes
Note:

In Zoho CRM, you can make certain fields mandatory for a particular transition in a Blueprint. When a user tries to save a record without filling in these required fields, Zoho CRM stops the action and shows a popup asking the user to complete the missing details.This popup is called the mandatory field form. This form also appears when you make fields mandatory using Layout rules.

3. Use Case

Zylker is a manufacturing organization which uses Zoho CRM. The Admin wants to ensure that at least one of the following fields is checked by the user before proceeding from the "Gather Details" transition.
  • GST ID
  • Payment Terms
  • Trade License Copy
  • Expected Monthly Order Volume
The following is the Blueprint configuration is for the transition "Gather details".



Blueprints only support marking fields as mandatory or optional, and there's no native way to enforce “at least one required.” However, the admin wants to add a custom validation to allow transition only if any one of these fields is filled. 

Solution

  • To accomplish this requirement, you need to create a Client Script with onBeforeMandatoryFormSave Event.

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


  • Enter the following script and click Save.
  1. if (form.Lead_Status == "-None-") {
  2.   if (
  3.     form.GST_ID_collected ||
  4.     form.Payment_terms_shared ||
  5.     form.Trade_License_Copy_collected ||
  6.     form.Expected_Monthly_Order_Volume
  7.   ) { ZDK.Client.showMessage("Transition Successful"); }

  8.   else {
  9.     ZDK.Client.showAlert("You must check at least *one* field to proceed");
  10.     ZDK.Client.navigateTo('record_detail', {
  11.       module: 'Leads',
  12.       record_id: $Page.record_id,
  13.     }); }}

  • In the above script, form is the argument of the onBeforeMandatoryFormSave Event. It holds the values of the fields in the mandatory form and the current value of the base field. Here the base field is Lead Status.

  • By checking the value of Lead_Status, the script ensures it only runs during the "Gather details" transition and does not trigger for other transitions.

  • The ZDK.Client.navigateTo() function redirects the user to the Detail Page and halts the transition process.

  • $Page.record_id is the Client Script constant that returns the current record id.

  • To inform the user, ZDK.Client.showAlert( ) displays the message "You must check at least one field to proceed", clarifying why the transition did not occur."

  • Here is how the Client Script works.


  • In this GIF, you can see that the transition is halted if none of the fields in the mandatory form are selected. However, if at least one field is checked, the transition proceeds as expected.

5. Summary

In this post, we have discussed 

  • When to use mandatory form events?
  • How to stop a blueprint transition based on custom logic?
  • How to navigate to a page using Client Script?
  • How to fetch the current record ID using Client Script?






    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

                                                                                                                • 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
                                                                                                                • Filter Pivot Chart by Criteria

                                                                                                                  Hey There Amazing Zoho Team, I wanted to see if there is a way to filter criteria a "Pivot Chart" report in the same way I can filter "List", "Calendar", & "Summary" reports. Example: I can filter a normal report like this: http://monosnap.com/image/y5q0XGzDSGZpsnOjuBYpdeUOFtSmFd I would like to do the same with a "Pivot Chart".  What I've Tried: Filters and User filters are not what I am looking for. That just filters the data. I want to be able to filter criteria the data by connected forms. Like
                                                                                                                • Big Time HELP

                                                                                                                  I am old, disabled and need to speak to a person. I needed to use a service to copy my zoom contacts to. I think I signed up for a security service, which I do not need. I don't know enough to choose from your many lists or how to see what I have and
                                                                                                                • #4 Setting Up Your Client the Right Way

                                                                                                                  Creating invoices without properly setting up the customer can quickly lead to several inconsistencies, such as duplicate records, missing billing details, and poor customer management. This becomes even more important for businesses that use a connected
                                                                                                                • 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
                                                                                                                • Email Parameter in Create Lead API

                                                                                                                  In the Create Lead API , the email parameter as mandatory. This is creating issues because many leads only have mobile numbers and no email address. This is especially a problem for businesses focusing on WhatsApp marketing in Zoho Marketing Automation,
                                                                                                                • Automatic Email Alerts for Errors in Zoho Creator Logs

                                                                                                                  Hello, We would like to request a feature enhancement in Zoho Creator regarding error notifications. Currently, Zoho Creator allows users to view logs and errors for each application by navigating to Zoho Creator > Operations > Logs. However, there is
                                                                                                                • Filter our rejected quote items from the inventory quote template

                                                                                                                  Hello, I am trying to have rejections at the line level on my quotes so I can track what items are often removed, I do not want to claim the whole quote as lost just the individual items for better data tracking. However I cannot figure out how to filter
                                                                                                                • Configuring ZMA Webhook for Zoho Flow : Missing Key Information Error

                                                                                                                  I'm looking to send a webhook to Zoho Flow at the end of a Marketing Automation journey in order to perform more actions that I can't do with just a journey. I have the Webhook created in Flow and set up in ZMA, however when I test it I get the error
                                                                                                                • Improve Zoho Vault search

                                                                                                                  Hello, we started using Zoho Vault and we really appreciate the app. At the moment, when searching passwords, the search query only targets the password name. I think having the query search among Name, User name, URL, Notes and Tag would be a better
                                                                                                                • NEED HELP

                                                                                                                  I have below data po no invoice no Party inv date value status 1 aa1 ABC 01-May-26 100 Under Cr 2 aa2 XYZ 02-May-26 200 Over Due 3 aa3 ABC 02-May-26 300 Under Cr 4 aa4 XYZ 03-May-26 400 Under Cr I need result as below using formulas (not Pivot table)
                                                                                                                • Ask the Experts 29: Knowledge Base, Community, and AI for smarter user education

                                                                                                                  Hi Everyone, Welcome to Ask the Experts (ATE) 29, a live panel discussion. After the engaging text-based discussions in ATE 27 on onboarding and managing agents and ATE 28 on handling customer support with AI, we’re bringing you the next round of ATE
                                                                                                                • Bigin, more powerful than ever on iOS 26, iPadOS 26, macOS Tahoe, and watchOS 26.

                                                                                                                  Hot on the heels of Apple’s latest OS updates, we’ve rolled out several enhancements and features designed to help you get the most from your Apple devices. Enjoy a refined user experience with smoother navigation and a more content-focused Liquid Glass
                                                                                                                • Tables for Europe Datacenter customers?

                                                                                                                  It's been over a year now for the launch of Zoho Tables - and still not available für EU DC customers. When will it be available?
                                                                                                                • Smart Feature Compatibility Indicators for CRM Field

                                                                                                                  Zoho CRM offers a wide range of field types and advanced customization options. However, several field types have feature-specific limitations that are currently documented only in help articles. For example, while configuring a Rich Text field, admins
                                                                                                                • 📢 Coming Soon: Daily Rate Projects

                                                                                                                  Hello everyone, We're excited to announce a long-awaited, new billing type for projects: Daily Rate! Until now, projects supported Fixed Cost and Hourly Rate billing. With this update, you can now create projects billed on a daily rate, making it easier
                                                                                                                • 📢 Coming Soon: Daily Rate Projects

                                                                                                                  Hello everyone, We're excited to announce a long-awaited, new billing type for projects: Daily Rate! Until now, projects supported Fixed Cost and Hourly Rate billing. With this update, you can now create projects billed on a daily rate, making it easier
                                                                                                                • PHPMailer "Connection refused (111)" Error Despite Outbound Ports Being Open

                                                                                                                  Hello everyone, I'm trying to send emails via Zoho SMTP using PHPMailer on my shared hosting environment. I've tried both port 465 (ssl) and 587 (tls), and I even added SMTPOptions to bypass SSL verification just in case it was an SSL certificate issue.
                                                                                                                • Cannot find IMAP/SMTP enable toggle in new Mail Admin UI - Mail Lite plan

                                                                                                                  Hi Zoho team, I'm the org Super Admin for owlmind.dev (Mail Lite plan, 3 paid users): - champ@owlmind.dev (Super Admin) - isfand@owlmind.dev - team@owlmind.dev I need to enable IMAP and SMTP access for all 3 users (we're integrating with Smartlead for
                                                                                                                • Kaizen #242 - Enabling In-Context Order Creation from Deals Using SlyteUI

                                                                                                                  Hello everyone! Welcome to another interesting Kaizen post. Today’s spotlight is on SlyteUI, the new UI builder designed to create powerful, intuitive user interfaces in minutes. Built for speed and simplicity, SlyteUI empowers teams to deliver high-impact
                                                                                                                • Zoho Books | Product updates | May 2026

                                                                                                                  Hello users, We're back with the latest updates and enhancements we've rolled out in Zoho Books. From sales tax automation to scanning receipts for free, explore the updates designed to upgrade your bookkeeping experience. Sales Tax Automation [US & Canada
                                                                                                                • No ingresan correos

                                                                                                                  desde el 28 de abril no ingresan correos, por favor me puedes ayudar
                                                                                                                • How to update image in a Zoho Creator report through widgets (JS API)

                                                                                                                  I need help with how to transfer an image file from one report to another in Zoho Creator using widgets (JS API). Say I'm fetching a record from the All_Products report. And this report contains a Product_Image field. I then want to transfer this Product_Image
                                                                                                                • Issue with Sending and Receiving Emails in Zoho Mail

                                                                                                                  Dear Zoho Support Team, I am facing an issue with my Zoho Mail account. I am unable to receive emails from others, and also when I try to send emails, they are not getting delivered. This is affecting my daily work, so I request you to please check and
                                                                                                                • Adding an element to the Creator Canvas will automatically adjust its dimensions.

                                                                                                                  I designed a report with fixed dimensions using Creator Canvas. However, whenever I add a new element, the system automatically adjusts the dimensions, even if the new element fits perfectly within the set boundaries. This is quite frustrating. Has anyone
                                                                                                                • Installing/Using Python Package in Zoho Creator

                                                                                                                  Hi, I have a Python function in my ZC application that depends on a specific Python package.  If I was running this on my own server, I would just install the package using pip (e.g. pip3 install stripe). Is there a way to install the package in my ZC
                                                                                                                • I dont have acess to my own domain emails

                                                                                                                  an agency made these 3 emails for us , including the one im using here. but the super admin access is through the agency email. i want to reclaim my admin console access to these emails. how can i contact zoho support?
                                                                                                                • Domain Activation Pending

                                                                                                                  Hello Zoho Support, I have resent the domain activation email for abovecapital.online several times, but I still have not received the activation link. Please check the email delivery status and help me resend the activation email or update the registrant
                                                                                                                • Zoho Webinar - Sharing System Audio (NOT AVAILABLE)

                                                                                                                  Hi, We are having a serious problem with Zoho Webinar. In the webinars we run, we very often share the audio from a video we are streaming directly from YouTube or other applications. Until recently we were using Zoom, but as we use other Zoho applications
                                                                                                                • IP blocked on SMTP

                                                                                                                  Please unblock my server IP: 135.181.19.115 We are using WP Mail SMTP for legitimate transactional emails.
                                                                                                                • Zoho rejecting external email – “Email policy violation detected”

                                                                                                                  Hello, I was informed by external senders that their emails to my addresses were rejected by Zoho Mail. The emails were sent from external domains (including pfms.ba.gov.br domains), not from my own domain. However, Zoho rejected the messages with the
                                                                                                                • unable to log in on iphone and unable to log in one auth

                                                                                                                  im unable to log in to my mobile
                                                                                                                • Tip #48: An exclusive system for risk management

                                                                                                                  Zoho Sprints' risk management feature gives teams a structured, industry-grade system for identifying, quantifying, and mitigating risks to eliminate probable impact. Project or product teams that run on Zoho Sprints might be using sprints, work items,
                                                                                                                • Follow-Up: No Response to Previous Inquiry on Workplace Plan Scalability

                                                                                                                  I have previously sent a few emails to your support address but have not received any response. I am unsure whether my messages are being delivered successfully or possibly filtered as spam. My most recent inquiry was regarding clarification on user scalability
                                                                                                                • Unable to receive any email

                                                                                                                  Hello I have several problems. I am unable to receive any emails sent to my Zoho account. Also, when I send an email, my account appears in the spam folder, and my profile picture doesn't appear; instead, a question mark appears.
                                                                                                                • Block opening tickets vía email DESK

                                                                                                                  Hello, I want to block the functionality of opening tickets when someone send an email to our support email address. Actually everybody in the world can open a ticket in our systen just sending an email to our support email address I don´t want this feature!!!! Please help! Thank you, Unai
                                                                                                                • 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.
                                                                                                                • Not able to receive mails

                                                                                                                  Am able to send mails. But not able to receive. The mail bounces back saying Your message wasn't delivered because the address couldn't be found, or is unable to receive mail.
                                                                                                                • Loading Zoho Webmail

                                                                                                                  Zoho Webmail don't work. Yesterday webmail works in the same web browser (Firefox). Webmail works on google chrome. Try to repair for Firefox.
                                                                                                                • Account blocked

                                                                                                                  My account contato@fernandovarella.com.br was blocked due to suspicious login activity. I am the owner of the account and domain. Please unblock web access and outgoing mail.
                                                                                                                • Next Page