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?







      Zoho Campaigns Resources


        • 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

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ





                                ご検討中の方

                                  • Recent Topics

                                  • Problem with CRM Connection not Refreshing Token

                                    I've setup a connection with Zoom in the CRM. I'm using this connection to automate some registrations, so my team doesn't have to manually create them in both the CRM and Zoom. Connection works great in my function until the token expires. It does not refresh and I have to manually revoke the connection and connect it again. I've chatted with Zoho about this and after emailing me that it couldn't be done I asked for specifics on why and they responded. "The connection is CRM is not a feature to
                                  • Kaizen #245 - Real Time Signal Alerts for High-Value Abandoned Checkouts

                                    Howdy, Tech Wizards! Welcome back to another week of Kaizen. In this post, we will build a real-time abandoned checkout notification system using Stripe, Zoho CRM Functions, Sales Signals, and Widgets. When a customer abandons a high-value purchase, Zoho
                                  • Unable to attach Fillable File Upload field to Merge Template ever since UI update

                                    Ever since the new UI update, the field for Attachments for sending document for Signing in Writer has had an issue where trying to add a Fillable item in the Attachment field ends up always becoming a "Choose a File From Drive" option instead. No matter
                                  • Latest updates in Zoho Meeting | An improved Analytics tab and user interface, an invite pop-up revamp, an enhanced Zoho Meeting iOS app, a recording feature in the Android app, and more

                                    Hello everyone, We’re excited to share a few updates and enhancements in Zoho Meeting. Here's what we've been working on lately: Improved analytics for meetings, an invite pop-up revamp, a multi-video feed interface in the iOS app, a recording feature
                                  • Inquiry Regarding Automated Assignment of Zoho TeamInbox Messages using Zoho Flow and Deluge

                                    Hello, Our company is currently using Zoho TeamInbox, and we are interested in automating the assignment of responsible parties using tools such as ZOHO Flow and Deluge. Is it possible to achieve this? Allow me to provide more details. Currently, when
                                  • [Bug] WebAuthn passkey registration blocked on rpIds with TLDs longer than 6 characters (.accountant, .technology, etc.) — isValidDomain regex too strict

                                    Hi, Filing on behalf of an enterprise customer where Zoho Vault is deployed across the company. The Chrome extension blocks WebAuthn passkey registration on legitimate sites whose Relying Party ID (rpId) has a TLD longer than 6 letters. This affects every
                                  • Celebrating the businesses behind Bigin: Customer Awards 2026

                                    Hello Biginners, We're excited to announce the very first Bigin Customer Awards! If Bigin has played a role in your organization's journey, we'd love to hear about it. Share your story for a chance to be recognized among the best Bigin users across industries.
                                  • Client Script Button in Related List become invalid

                                    Hi, I am the admin of our organization. And I setup a client script button in related list to raise payment refund request While this button become non selectable recently. I believe there is something wrong from zoho as this button had run for a year.
                                  • Send Email Directly to Channel

                                    Hi, We are coming from Slack. In Slack each channel has a unique Email address that you can send emails too. I currently forward a specific type of email from my Gmail InBox directly do this channel for Verification Codes so my team doesn't have to ask
                                  • Zoho Desk: Auto-resizing of the "Description" textarea when creating a ticket.

                                    I would like to suggest an improvement for Zoho Desk regarding the Auto-Height-Resizing for Description field on the “Create a Ticket” page. It would be highly beneficial if the editor supported auto-resize functionality, allowing it to adjust dynamically
                                  • [URGENT] Cannot access Functions tab in CRM

                                    Navigating to /settings/functions/myFunctions gives this error message: "Sorry, something went wrong. Please try again later." I raised this issue with Zoho Support on Monday (3 days ago) but have not heard back. I'm sure it's clear how important it is
                                  • Not able to see appointements when the territory permission is activated

                                    Hello, I created different territories to separate the various departments within the company that will be working on different projects. The issue I am currently experiencing is that when I enable territory-based permissions, I can see the work order
                                  • Accepting Event from Outlook Client

                                    I've noticed this behavior for a few years now. If an Event is created from CRM and sent to participants and the participant accepts the invitation using Outlook client, Zoho event won't be updated as "Going" it only works if the recipient accepts it
                                  • Is there an API endpoint to retrieve the remaining email credit balance?

                                    Hi everyone, Is there any way to retrieve the remaining email credit balance programmatically through the API? I've gone through the full API documentation and it seems like there's no endpoint for this — everything related to credits is only visible
                                  • Switch between multiple LLMs instantly for tailored Zia experiences

                                    Availability Editions: Professional , Enterprise, Ultimate , CRMPlus , ZohoOne Release Plan: Available for all DCs Hello everyone, Previously, the multi-LLM feature supported only one LLM at a time for Zia Record Assistant, which restricted users' flexibility
                                  • Zoho CRM Community Digest - April 2026 | Part 2

                                    Hello Everyone! We're back with Part 2 of the April Zoho CRM Community Digest to wrap up our monthly roundup. This week, the spotlight is on smart database connections, proactive error tracking, and optimizing subform line items without breaking your
                                  • 【西日本初開催】「AI and DX Summit 2026」のご案内

                                    ユーザーの皆さま、こんにちは! 西日本初開催となるZoho ユーザー / 検討中の方々向けイベントのご紹介です。 AI・DX大型カンファレンス「AI and DX Summit 2026」を、2026年7月16日(木)に開催します。 会場は、ウォルドーフ・アストリア大阪。 グラングリーン大阪直結のラグジュアリーな空間で、AIとDXの最新トレンド、実践事例、 展示、ネットワーキングが集結する、特別な1日をお届けします。 👉イベントページを見る ━━━━━━━━━━━━━━━ AIとDXの“今”を、体感。
                                  • 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).
                                  • Stop by and explore our six updates in ABM for Zoho CRM

                                    Dear Customers, We hope you're well! ABM for Zoho CRM is built to sharpen your database so that you engage with the right set of customer accounts. To fine-tune it further, we have six new updates: New access location for ABM Refined account entry criteria
                                  • Tracking Emails sent through Outlook

                                    All of our sales team have their Outlook 365 accounts setup with IMAP integration. We're trying to track their email activity that occurs outside the CRM. I can see the email exchanges between the sales people and the clients in the contact module. But
                                  • Enhancement in Zoho CRM: Introducing New Return Types for String Fields Based on Character Length

                                    Dear Customers, We hope you’re well! In Zoho CRM, formula field with string return type is used in various scenarios where text is involved like concatenating customers’ first and last names, trimming characters from texts, performing find and replace
                                  • Cross Module Filtering – Use Fields from Lookup modules in Custom Views criteria and Advanced Filters

                                    Hello everyone, Zoho CRM now enables you to achieve deeper filtering of records in a module, using fields of a lookup, thereby enhancing your data management experience manifold. This filtering based on lookup module fields is now available in advanced
                                  • Incoming Rules: Define how incoming emails are evaluated and handled

                                    As organizations grow, managing incoming emails manually becomes increasingly difficult. Administrators often need more control than what a standard spam filtering can provide. Whether that's enforcing company-wide email policies, handling messages from
                                  • Zia Emails Summary: Instant context from past emails

                                    Hello all, Reading all of the past emails associated with a specific record can be tedious, which in turn makes it difficult to understand the context quickly, as these messages often include irrelevant details that waste time. This is true for everyone
                                  • Boost your CRM communication with new font types, sizes, and default reply-to options while composing emails

                                    Hello Everyone, We’re excited to introduce a series of impactful enhancements to the email composer settings in Zoho CRM. These updates enable you to personalize and optimize your customer interactions with greater efficiency. So what's new? Add custom
                                  • Custom Portal URL causing SAMEORIGIN error with embedded Page snippet

                                    In my app, I have a page that embeds another page. The URL that I have for the embedded page starts with https://creatorapp.zoho.com but the custom domain I have set up is https://kors.kerndell.com. Because the user logged into the app at https://kors.kerndell.com,
                                  • Automating CRM backup storage?

                                    Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                  • Bing ads integration and tracking

                                    Hi, Is there any way to track Bing ads in the same way that we are able to track google adwords?  It is important for us to be able to determine the conversion rate of our Bing ads.  If this is not possible now, will this feature be added in the future?
                                  • Zoho Creator Calendar - Sorting Events

                                    Hi, I have a calendar view to hold the schedule for a group of engineers. I have created a formula field to show the combination of fields I want visible as the title of the event, but I need to be able to sort the list by something other than the event
                                  • Create a "My saved custom themes" section in Zoho Forms

                                    Hi! I created lots of forms for my company that we embed on the website with a custon design. It is a pain not to be able to save a custom layout as a template and just not to have to do it again! So could you add a gallery like : "My saved themes" ?
                                  • Upcoming Update: Disposition Sync for Indeed

                                    We’re updating our Indeed integration to support Disposition Sync, improving how candidate application statuses are communicated. This change is scheduled to go live on 15 June, 2026. What’s changing? Once enabled, this allows candidate application statuses
                                  • Joining Two Tables on Multiple Ids

                                    Hello all, I'm guessing there is an obvious solution for this, but definitely not an expert in sql. On our Deals module, we have two user lookup fields. In Analytics, those fields have the user's ids in those table rows, and I'm trying to create a query
                                  • auto update of item purchase cost

                                    Would be nice if, when entering bills, the price of the item varied from the stored item price, we could have a user dialogue "Update item price" | "yes / no". Simple, but saves a lot of additional work !
                                  • Journeys - How to set up a webhook that triggers when a contact meets the goal criteria?

                                    Hi there, I'm setting up a journey on Marketing Automation. The main goal of the journey is to get the leads to reply our emails. Is there a way to trigger a webhook when that goal is met? The webhook would then trigger a notification. Is that possible?
                                  • Latest updates in Zoho Meeting | Personal Meeting Rooms and Zoho Meeting Annotator

                                    Hello everyone, We’re excited to share a few updates for Zoho Meeting. Here's what we've been working on lately: Introducing Personal Meeting Rooms - Tailored for private discussions, this secure meeting space is yours alone, accessible via a unique link.
                                  • Canvases Auto-Skewing/Adding Scroll Bars When They Were Not There Prior

                                    Is anyone else noticing rendering issues in their canvases today? It seems to be mainly icons which now have scroll bars added which makes them all look off, though some fields seemed to revert to squished length as well. Were the icons replaced with
                                  • New UI for Writer - Disappointed

                                    I've been enjoying Zoho Writer as a new user for about 6 months, and I really like it. One of my favorite things about it is the menu bar, which you can hide or leave out while still seeing most of your page because it is off to the left. I think this
                                  • The reason I switched away from Zoho Notebook

                                    My main reason for switching to Zoho was driven by three core principles: moving away from US-based products, keeping my data within India as much as possible, and supporting Indian companies. With that intent, I’ve been actively de-Googling my digital
                                  • Introducing the enhanced Zoho People integration

                                    We're excited to announce an enhancement to the integration between Zoho Recruit and Zoho People, designed to streamline your data management processes and boost efficiency across your recruitment and HR workflows. With this latest update, you can now
                                  • Zia should track how customer relationships evolve over time

                                    Here's a feature idea that I've been thinking about The Problem Zia is great at analyzing individual interactions email sentiment, call transcription, best time to contact. But here's what it can't do: tell you how a relationship has evolved over time.
                                  • Next Page