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

    • Upcoming Change: Increased character limits for module and field labels

      To provide greater flexibility in customizing your CRM, we are increasing the maximum character limits for module labels and field labels in Zoho CRM. What's changing? Label Current Limit New Limit Module Label 25 characters 50 characters Subform Module
    • Change of Blog Author

      Hi, I am creating the blog post on behalf of my colleague. When I publish the post, it is showing my name as author of the post which is not intended and needs to be changed to my colleague's name. How can I change the name of the author in the blogs?? Thanks, Ramanan
    • SPAM (and some other) folders missing on three of my Zoho Mail accounts

      I have four email accounts with Zoho Mail. Three days ago, the Spam folder on three of these accounts vanished. It is gone on the Windows and Linux desktops as well as the web-based and Android versions, and I have tried it on multiple machines. The only
    • Using data from multiple sheets

      I am looking for a way to automate the process of taking multiple Zoho sheets and collating the data into one combined sheet (such that no duplicates occur). Currently I can only think of importing all the sheets into Excel and then running a macro to perform the task. Is there a simpler way offered by Zoho?
    • 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
    • Error 1011 saving website personalisation — blocking all changes (corrupted "home_page.content" field)

      When trying to save changes under Settings → Brands → MY COMPANY → Website → Personalisation → Messenger, I receive the following error: "Either the request parameters are invalid or absent" upon checking on the developer console of the browser I get
    • Tip #7 - Siri shortcuts in Zoho CRM

      Hello Everyone, Here is a tip about the 'Siri Shortcuts' feature and how it works in the iOS version of the Zoho CRM mobile app. What are Siri shortcuts? Siri Shortcuts are quick actions across your apps on iOS. They can perform an action automatically
    • Automatic Department and Employee Sync Between Zoho One and Zoho People

      Dear Zoho Support, I'm writing to propose a valuable feature request that would streamline data management and improve user experience within the Zoho ecosystem: automatic synchronization between departments and employees in Zoho One and Zoho People.
    • Nothing triggers a Journey

      I have been on the phone with Zoho support and they claim their development team needs to investigate more. However, I've found this is a pretty standard answer after a call takes any amount of time. After that, it's days and even weeks before it actually
    • Manually Backorder Sales Order and/or Change Sales Order Status

      Is there an option to manually 'backorder' a sales order, or otherwise change it's status?  In some cases, we receive orders for products that are out of stock, but we already have issued POs to our suppliers for replenishment.   Ex- we created a PO on
    • Backorder process review - Automating Removal of Sales Order from "On Hold" When PO is Received

      Hello Zoho Inventory Team, Currently, sales orders in On Hold status are released only when the bill for the purchase order is created. In our workflow, it would be much more efficient if the sales order could automatically move out of On Hold as soon
    • Kaizen #254 - Building a Temporal Lead Score Decay System in Zoho CRM

      Hello, CRM Wizards! Welcome to a fresh week of Kaizen. In this post, we will build a temporal lead score decay system that works alongside your existing scoring rules by introducing percentage-based score decay driven solely by customer inactivity. By
    • Metadata API Access to Functions

      I think it would be incredibly helpful to have api access to every function's code. Our team primarily uses deluge functions to update fields across modules according to business logic. I would like to create a visual dependancy model for our CRM, but
    • API actions/approvals endpoint returns UNAPPROVABLE despite user having full permissions and being the assigned approver

      Hi Team, We are trying to programmatically approve a record via the CRM API but consistently receive an UNAPPROVABLE error, even though the same user can approve the record without issue from the UI. Endpoint called: POST https://www.zohoapis.com/crm/v6/{module}/{record_id}/actions/approvals
    • Get a realistic picture of your revenue with Forecast Adjustments in Zoho CRM

      #crm25q1 Dear Customers, We hope you're doing well! Today, we're here with an important enhancement for business decision makers: forecast adjustments. Let's get straight to it! With technology on the rise and CX at its core, businesses are constantly
    • I am not able to check in and checkout in zoho people even location access allowed

      This issue i am facing in mackbook air m1, I allowed location in chrome browser and i also tried in safari but getting similar issue. Please have a look ASAP.
    • WhatsApp Vendors Module

      Hello, so WhatsApp works with the below, mainly with the customer side modules. Can we get functionality on the vendor side modules, i.e., PO, Bills, Vendor Credits, Payments Made, Purchase Received? WhatsApp is often the preferred method of communication
    • Upload ticket attachments via Drag-&-Drop

      Hello, if you want to upload a file to the ticket attachment you need to click the button and use the file browser to select and upload the desired file. In many cases, it would be much more efficient if you could simply drag the file to the browser window...
    • Elevate your Radar experience: Best practices part 3

      In the Spotlight: Zoho Desk's Radar app Customer support requires human intelligence combined with emotional intelligence. How about these coupled with contextual intelligence? These elevate the customer support experience. When providing support through
    • Migrating my email from GMAIL to ZOHO MAIL..........

      I am a long time GMAIL user and I really only understand how they operate, but after reviewing your tutorials and forums online, it is quite unbelievable how much more and how much more streamlined ZOHO mail is, not to mention ZOHO's wonderful, more advanced capabilities. I do have several questions about transitioning over to ZOHO.  Primarily, where is the best place to start, what do I do first? And how hard is it actually to move all my business and personal accounts over here?  When I sign up
    • Unable to send message;Reason:553 Relaying disallowed. Invalid Domain

      Hi, Now when I try to reply to an email, I see the Unable to send message;Reason:553 Relaying disallowed. Invalid Domain voicemessagedownloader.com error. I tested sending an email when I set it up in the past and it worked. I have checked the Zoho Organization
    • RFID Scanner/Adapter Solution for barcode scanning

      Hello, We will be trialing using barcode scanning for item verification during our picking process. Using a phone or a tablet is awkward and uncomfortable. Are there any Zoho compatible RFID scanners, or an RFID device/adapter that will connect with a
    • Approval Process not retriggering after rejection when stage is manually changed back

      We have an Approval Process on the Opportunities module that triggers when Stage is changed to Negotiation (Execute on: Edit Only). On rejection, a field update action reverts Stage back to Proposal. The issue: after rejection, AE can manually changes
    • Free Webinar Alert! Workdrive + Office Suite in Zoho Workplace: Create, co-edit and collaborate

      Hello Zoho Community! Looking for a better way to create, manage, and collaborate on your business documents? Join our upcoming webinar to discover how Zoho WorkDrive and the Zoho Office Suite (Writer, Sheet, and Show) help teams to work together from
    • Updating Sales orders on hold

      Surely updating irrelevant fields such as shipping date should be allowed when sales orders are awaiting back orders? Maybe the PO is going to be late arriving so we have to change the shipment date of the Sales order ! Not even allowed through the api - {"code":36014,"message":"Sales orders that have been shipped or on hold cannot be updated."}
    • Two-Factor Authentication in Zoho Mail: Add an extra layer of security to your organization

      Account security is a critical aspect of managing any organization's email. With increasing risks of unauthorized access, a single password may not always be sufficient to keep accounts protected. Zoho Mail's Two-Factor Authentication (TFA) addresses
    • Dark Mode - Font Colors Don't Work

      When editing a document in Dark Mode and selecting font colors, they don't show up on screen.  Viewing/editing the same document in Light Mode shows them just fine.
    • API to post drafts for social media

      I we want to post draft posts to our zoho social account and then approve and schedule them within Zoho social. is this possible with for example: https://apis.zoho.com/social/v2/post TIA Jon
    • How to show product cards in your chatbot

      Hey everyone, If you are using Guided Conversations to help customers find products, you have probably run into this problem: the bot gives customers a list of options, but they still have no idea which one to pick. There will be no images, no specs,
    • Changing settings for auto logoff

      I've noticed that when I haven't used Cliq for a while, I have to re-enter my password. That is really clumsy, especially if you have a complicated password. Because it won't be filled in automatically. Is there a way to change that behaviour? We are
    • How do you create invoices before sending them through Zoho Invoice?

      Hi everyone, I'm curious how other businesses handle their invoicing workflow before sending invoices through Zoho Invoice. Do you: Create invoices directly inside Zoho? Prepare them first in another invoice tool or template? Use Excel or Word before
    • ZML Error/Bug

      Hi, I would like to request for your help regarding this kind of behavior. Requested_Start_Time & End_Time - date-time fields https://......#Page:PH_Calendar_Page?reqDate=08-04-2026 https://......#Page:PH_Calendar_Page?reqDate=07-31-2026 https://....#Page:PH_Calendar_Page?reqDate=08-03-2026
    • Item with name in different languate

      Hello, is there a way to have an item with its name in different languages? For example: I sell an item in different markets and I'd like to have a Proposal and the Invoice with the Item Name in a specific language. Rino Bertolotto Zoho Specialist, STESA srl
    • Migration of emails from Yandex to Zoho

      I am trying to migrate an yandex mail account to zoho mail account. I am confused with all the related articles/informations in the net. Could someone please outline the process to do it, just thinking about me as a novice with limited knowledge or experience. A couple of questions from the knowledge gained. 1. I believe we have to delete the yandex current MX from the website records and add Zoho MX. What happens to the emails as we remove the mail exchange record. Yandex stops updating emails and
    • Calling a function within another function

      Hello there, I have just found out that you can simply call up functions in other functions, regardless of the department. You can't create functions with the same name twice, even though you are in a different department. If you try it, you don't get
    • 【続々公開】Zoholics Japan 2026 セッション情報を更新しました!

      ユーザーの皆さま、こんにちは! Zoholics Japan 2026のセッション情報を続々と公開しています! 今年は3つのトラックで、Zohoの最新情報やAI活用、製品アップデート、 活用事例など、多彩なセッションをお届けします。 現在公開中のセッション(一部) ・Zoho CRM 製品アップデート ・Zoho CRM Plus 製品アップデート ・Zoho Community セッション ・Zoho Desk セッション ・中堅・成長企業の人事DX ~AI時代に何から始めるべきか?~ ・Zoho
    • New Ways to Personalize, Organize, and Share Your Notes

      We're excited to introduce a new set of enhancements in Zoho Notebook that make your note-taking experience cleaner, more flexible, and easier to share. With this update, you can create notes that automatically adapt to your device theme, browse your
    • Introducing spam detection for webforms: An additional layer of protection to keep your Zoho CRM clean and secure

      Greetings all, One of the most highly anticipated feature launches—Spam Detection in webforms—has finally arrived! Webforms are a vital tool for record generation, but they're also vulnerable to submissions from unauthenticated or malicious sources, which
    • Rich-text fields in Zoho CRM

      Moderation Update: During the initial release of Rich Text fields, it was supported only in the Enterprise and Ultimate editions. We have gradually extended Rich Text fields to all the paid editions of Zoho CRM. Hello everyone, We're thrilled to announce
    • Email-Data Synchronization with Zoho Analytics

      Hello, Enterprise Support Community! We're excited to announce the availability of Email Data Synchronization with Zoho Analytics! This highly requested enhancement allows you to sync email data from Zoho CRM into Zoho Analytics, making it easier to analyze
    • Next Page