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?






    • 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

    • Zoho ERP | Product updates | July 2026

      Hello users, We're back with another round of updates to help you streamline your operations. This month's release brings new features and enhancements designed to help you work more efficiently. Read on to discover everything that's new in Zoho ERP this
    • Show when an invoice has been viewed

      It would be nice to know if/when a customer has viewed an invoice. This would mean not having PDF attachments and just have the link to the invoice. My previous invoicing solution had this feature and I did not realize how much I used it until it was gone. Would this be possible, or this already available and I am just missing it?
    • Customer image field

      I created a custom image field for estimates, and it works as expected. The only issue I have is that I want to be able to place the custom image field in the estimate invoice. Is there a way I can do that, the field does not give the option to display
    • Zoho Books | Product updates | March 2026

      Hello users, We’ve rolled out new features and enhancements in Zoho Books. From Advanced Reporting Tags to the ability to mark projects as completed, explore the latest updates designed to improve your bookkeeping experience. Introducing Advanced Reporting
    • Separator line

      Is there a way i can insert a line in an invoice or quote without showing qty or prices? e.g. Options I Item description qty and price Option II Item description qty and price Thanks
    • 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
    • BCC Drop Box Centralisation

      Hi Team, For the last few years, I have had a question related to the Zoho CRM BCC Dropbox feature. Although BCC Dropbox is very useful for tracking customer email communication, I have always wondered why its configuration is managed at the individual
    • Kiosk Page Refresh

      We have a Kiosk running from a button in contacts to update values and also add related lists, which works great, but when the kiosk is finished the page does not refresh to show the changes. Is there a way to force the contact to refresh/update when
    • CRM Integration - Option to Sync Reporting Tags

      It would be nice to be able to sync reporting tags in Zoho Finance to a custom field in Zoho CRM. My use case is for a Customer in Finance to an Account in CRM (and vice-versa, of course), but I'm sure it's pretty obvious that this could also be used
    • Zoho Books | Product updates | August 2026

      Hello users, July has been an exciting month for Zoho Books! This month, we're excited to introduce HTML PDF Templates, Placeholders as Pills, expanded approval workflows for Sales Returns and Journals, and significant compliance updates across the India,
    • Join the Zoho Desk Virtual Classroom Training (VCRT)

      Hello everyone, Have you heard about Zoho's Virtual Classroom Training (VCRT)? Zoho Desk's Virtual Classroom Training offers end-to-end training for Zoho Desk users. Join the VCRT and get hands-on guidance for setting up Zoho Desk and getting your business
    • Make Rich Text fields available in Canva Print Views

      Everything is on the title. I don't really understand why this is not already possible as Rich Text Fields are available in Canva Detailed Views for example.
    • Zoho CRM Approval Process based on Field Update

      Hello, In current structure, Zoho CRM send records to approval based on record creation and edit.  I think, it should be to set approval process trigger based on any field update in record. When the user update any field, the record can assign to approval
    • Where do I edit the "Welcome to [portal name]" message

      I am looking for a way to edit the "Welcome to" part of the message that is seen on the landing page (ex: https://help.zoho.com/portal/en/home). When I use the French interface, it doesn't make sense... I want to change it from "Bienvenue chez" to" Bienvenue au". Thanks!
    • Approve records efficiently: Useful enhancements to My Jobs module and Approval process in Zoho CRM

      Dear Customers, As you might know, approval process is a process automation tool that allows you to automate approvals in your organization and My Jobs is where you approve requests from a single point of view. Here's how you'd go about it: You’d add
    • Zoho Assist may be a struggle for repeatted clients

      I am supporting people via AnyDesk and sometimes via Acronis CyberProtect Connect. The latter is EoL this year. Some clients are computer illiterate or have poor vision and even getting them to go to a website is a struggle and to download something and
    • Filter isn't

      The ability to filter the history of a given flow to a specific status however it would be great to have the ability to filter to a status that isn't something for example if i want to find all history that isn't complete.
    • Introducing the Store Locator widget

      Hello everyone! Your website is often the first place customers visit before deciding where to shop. But when they can't quickly find the nearest store, check business hours, or get directions, many leave your website and search elsewhere. Every extra
    • Important updates to your connectors

      Hello everyone, Greeting from Zoho Creator! We're excited to announce that we'll be rolling out significant backend updates to Zoho Creator's built-in connectors to enhance security by following the latest frameworks. The existing version of some of the
    • Important updates to your Salesforce integrations in Zoho Creator

      Hello everyone, We're writing to inform you of an important change regarding Salesforce integrations in Zoho Creator. Salesforce has introduced new security requirements for third-party platforms that connect with their services via APIs. To comply with
    • Password Policy in Zoho Mail: Set password rules to keep your organization secure

      Weak or repetitive passwords are one of the most common causes of unauthorized account access in organizations. Zoho Mail's Password Policy feature allows administrators to define and enforce specific password requirements for all users in the organization,
    • What is Workqueue and how to hide it?

      Hi, My CRM suddenly have this "Workqueue", may I ask how to set the permission of this tab?
    • Zoho Community Digest - July 2026| Part 4

      Hi everyone, and welcome back! We're closing out July with a strong final week, from a major LinkedIn integration in Zoho Recruit to AI-powered forecasting in Zoho Analytics. There are also a few heads-ups worth noting, including API changes in Zoho CRM
    • Zoho CRM Community Digest - July 2026| Part 2

      Hello everyone! The second half of July brought five CRM updates, including a heads-up for developers on API changes coming in October, one Quick Win on keeping your attribution data intact through lead conversion, two Dev's Corner threads worth bookmarking,
    • Shared Snippets Everyone

      Hi, Now that the Shared Snippets have been released and I think will be the most used feature implemented in 2023 :) Creating and Using Snippets in Ticket Responses - Online Help | Zoho Desk Maintain consistency in ticket responses with shared snippets
    • Keeping project teams in the know with Zoho Cliq

      Project management is all about processes, data flow, and maintaining order. But communicating appropriate information at crucial times to stakeholders is as important as the moving parts of a project. Zoho Cliq can facilitate effective communication
    • Remove "Subject" as a required field on quotations

      Not sure why, but Zoho has made 'Subject' a system defined required field. I'm not entirely sure why subject would be required as a key field (i.e. you cannot deactivate it or change it from required). It doesn't make much sense on many product quotations,
    • Multi-currency and Products

      One of the main reasons I have gone down the Zoho route is because I need multi-currency support. However, I find that products can only be priced in the home currency, We sell to the US and UK. However, we maintain different price lists for each. There
    • Enable Credit Note creation for Sales Returns BEFORE receiving goods

      Currently, it is not possible to issue a Credit Note linked to a Sales Return until the goods have been officially marked as "received" in the system. In our business, we often need to issue a credit note to our clients immediately upon the initiation
    • Best way to setup Inventory bin tracking for products with multiple boxes/crates

      Hi - we need some advice from the community on setting up Items in the Inventory for products with multiple crates. We have large products in our warehouse where the product is delivered as two large (double pallet) crates. We've setup the Items for these
    • Getting Internal Server Error message when filing for MTD

      I am trying to file for the MTD submission, and after I filled in all the information and click (Fetch Obligation) this message "Internal Server Error [500]" pops up. I have been trying for awhile and its still the same. What shall I do as today is deadline
    • No access to change view permission for team members

      Hi, I want team members to be able to update the percentage progress on their goals at mid year. Currently they cannot edit this, they can only update the comments against the goals. The ability to add view permission to goal progress for team members
    • Turn your Zoho One Home into your workspace with Dashboard 2.0

      When you open Zoho One, you probably don't need to see everything. You need to see what matters to you. A sales manager may want to track pipeline and revenue. An HR manager may want to monitor employee information. A business leader may want a quick
    • Zoho Assist Feature Update: August 2026

      Web Forms Web Forms in Zoho Assist help you collect support requests directly from your website and route them to the right team. Embed a customizable form so customers can raise issue details or join an active remote session using a session ID. Depending
    • Tip #84 – A More Natural Remote Experience with Custom Cursor Support – 'Insider Insights'

      Hello Zoho Assist Community! Anyone who has spent time in a remote support session knows the feeling. You're guiding a customer through a task, moving the cursor across the screen, and something feels just slightly off. The cursor doesn't behave the way
    • 【無料/オンライン】8/20開催|Zoho ワークアウト|ユーザー同士で学び合うオンラインもくもく会

      ユーザーの皆さま、こんにちは。 コミュニティグループの中野です。 8月20日(木)開催の「Zoho ワークアウト」をご案内します。 Zoho ワークアウトは、参加者それぞれが取り組みたいテーマを持ち寄り、 ユーザー同士で交流しながら、設定・検証・運用改善を進めるオンラインの「もくもく会」です。 「作業を進めたいけれど、一人だと手が止まってしまう」 「他社がどのように活用しているのか知りたい」 「同じ課題を持つユーザーと情報交換したい」 そんな方は、ぜひお気軽にご参加ください。 ▶︎ 参加登録はこちら(無料)
    • Assign Price Book to Accounts (again!)

      I can see this topic has been bumping about for over 10 years and unfortunately Zoho hasn't seen the need (or use case) in CRM to be able to assign an account to a price book to automate quoting (amongst other things). Strange given they DO assign price
    • Custom Statuses - Can You Do Anything With Them?

      As far as I can tell, one really cannot do much with custom statuses. I created a new custom status for sales orders called "Customizing / Hold". This is for sales orders that have the Confirmed status. The use case here is that, as an e-commerce company,
    • Price Book in foreign currency

      We have many customers who buy in foreign currency (USD), where our base currency is our local currency (AUD). It would be normal (it is in Zoho Books, Zoho Inventory etc.) to assign a currency to a price book, but I cannot find this option in Zoho CRM
    • How to disable option to search (In Advanced Field > Matrix Choice > Dropdown)

      In Advanced Field > Matrix Choice > Dropdown I don’t want the option to search or type to fill in words. How can I disable or remove this function?
    • Next Page