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

    • Collapsible Sections & Section Navigation Needed

      The flexibility of Zoho CRM has expanded greatly in the last few years, to the point that a leads module is now permissible to contain up to 350 fields. We don't use that many, but we are using 168 fields which are broken apart into 18 different sections.
    • Create custom rollup summary fields in Zoho CRM

      Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
    • Inventory batch details

      Hi there, I'm trying to get the batch details of an item, here's what I've done so far. I've sent cUrl request to the below endpoint and I get a successful response. Within in the response I find the "warehouses" property which correctly lists all the
    • How do I edit the Calendar Invite notifications for Interviews in Recruit?

      I'm setting up the Zoho Recruit Interview Calendar system but there's some notifications I don't have any control over. I've turned off all Workflows and Automations related to the Calendar Scheduling and it seems that it's the notification that is sent
    • Unable to send emails from iPhone and iPad

      Curious, all of a sudden I'm unable to send emails from iPhone and iPad. I keeps asking for my password again and again. No problems from my MacBook Pro.
    • Journal Entries Do Not Show Multiple Entries to the Same Account

      Another basic accounting function that Books ... Accountants sometimes write journal entries, debiting and/or crediting the same account in the same entry. This is due to the need to record specific activity in an account when we pull reports especially
    • Create static subforms in Zoho CRM: streamline data entry with pre-defined values

      Last modified on (9 July, 2025): This feature was available in early access and is currently being rolled out to customers in phases. Currently available for users in the the AU, CA, and SA DCs. It will be enabled for the remaining DCs in the next couple
    • Partial customer Refund via customer Credit Card used to pay invoice

      How can we process a partial refund through the same credit card that a customer used to pay the initial invoice? - In other words, say a customer was sent an invoice for $1200.00 and they paid it through Zoho with our online credit processor, PayFlow
    • Partial refunds

      I am trying to process refund for a one item invoice, however the refund is partial: i am getting this error while creating credit note, can anyone share some wisdom about this
    • How in the heck do i record a (partial) refund???

      I have a client. wrote an invoice for 3 services totalling $520. He paid it online (we use zoho to authorize.net) We went out and couldn't do one of the services I didn't see a way to initiate a refund through zoho books, so i did a $250 refund through authorize.net. Tried to edit the payment on zoho books, but it won't let me b/c "this payment was made on line" When i try to edit the invoice i get a popup about it no longer matching the payment. What do I do??? And why is it so hard to do something
    • Action Required: Update your Zoho Projects – Zoho Analytics integration

      Dear Zoho Projects integration users, We would like to inform you about an upcoming update to the Zoho Projects–Zoho Analytics integration. Read the full migration announcement here. As shared in the announcement, we are updating the integration to support
    • Mirror Component in Zoho CRM: Access real-time related data without leaving your record

      Hi everyone, This feature is now available for the JP, CA, SA, UAE, and AU DCs. We're excited to bring to you Zoho CRM's mirror component, which presents relevant data on a record's details page and keeps everything users need in one place without having
    • Workflows fail silently in Zoho CRM and there is no native way to know

      Workflow automation is honestly one of the biggest reasons my clients choose Zoho. But there is one problem I keep running into across almost every implementation. When a workflow fails, nobody finds out. Email alerts hit daily limits and just stop. Custom
    • Office365(outlook emails) Zoho CRM integration

      Hi guys We're looking to buy Zoho CRM and are currently trialling. I'm working from a MacBook fyi. I've so spent 3 hours on live chat today with Zoho as we couldn't get the two to integrate properly, even with the plug in installed but finally managed
    • When adding subform records, how do I access member fields of a name field

      I have the following code (runs when a record is added to a form) if (input.P_liza != null) { input_deal = input.P_liza; rec = form_mapping[deal_name == input_deal]; id = input.N_mero_de_documento_de_Identificaci_n_Alfanum_rico; contact = -----redacted------.get_crm_contact_by_id(id);
    • Making "All Day Events" not default

      When I go to schedule an event, the All Day checkbox is ticked by default. Generally, I don't plan all day events, so is there a way to make that not checked by default? I couldn't find a setting for this...
    • Create custom field in multiple modules

      I am trying to create some custom fields that will be in both leads and contacts module without having to create them separately and then mapping them. How is that performed? it is too time-consuming to create 20+ fields and then do the same thing in a different module when they carry the same info. The idea is that when we get a lead from web site, there are items that we capture and once that lead is a client and moved to Contacts, that info should come over. So trying to find an easy way to create
    • Allow 2 logos for Branding, one for Light Mode and one for Dark Mode?

      Our logo has a lot of black text on it. If we leave the background transparent, per recommendation of Zoho, when a user is viewing a file and turns on dark mode, our logo is not really visible and looks really weird. It would be really great if we could
    • Compensation | Salary Packages - Hourly Wage Needed

      The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
    • In Desk KB article, how do include an image in a numbered list without using a number or bullet?

      We need to include images in our KBA steps as a numbered list. Here I have numbered steps. I want the image no numbering or bullet. Open Purchase Order Entry. Select the mail icon: Select the Save button. I see your own articles have images in number
    • Video Interview features

      I tested the video interview feature. It's supported only on desktop version of chrome/firefox. Most of the times, the candidates are available on their cellphone. Need to have this for mobile devices too.
    • POS and payments

      Have i missed the point can i not use zoho POS as a payment terminal back into stripe like we can in Books?
    • Delugeサーバーページ(HTML)での関数の使用方法

      Zoho Creator、Deluge並びに初心者です。 題名の通りDelugeサーバーページ(HTML)で関数が使用する方法を教えて頂きたいです。 ざっくりと説明します。 現在、1週間だけカレンダーを表示するページをelugeサーバーページ(HTML)内で作っております。 カレンダー内のボタンには翌週や先週を表示するボタンを追加しようとしています。 それらのボタンを押下した際、現在の日時に±7日をしてページを表示しなおす処理が走るようにさせたいです。 ボタンが押下されたとき、用意していた関数でその処理を実行する想定です。
    • Automatically remove commas

      Team, Please be consistent in Zoho Books. In Payments, you have commas here: But when we copy and paste the amount in the Payments Made field, it does not accept it because the default setting is no commas. Please have Zoho Books remove commas autom
    • Why does my salesiq dashboard doesn't look like the one on the admin guide?

      https://help.zoho.com/portal/en/kb/salesiq-2-0/for-administrators/setup-brand/articles/setting-up-the-website-channel#Launcher
    • ENDPOINT ZOHO CREATOR

      I created a function to perform the action of POST, GET and PUT in order to use it outside our portal and create more dynamic forms using a cloud server. Params = “qAvhbBBJJsQysd45DdkvTR34A” Curl = “https://www.zohoapis.com/creator/custom/admin2844/vallesalud_julaje_private?publickey=”;
    • MCP > Creator connection failing with Claude

      I'm trying to get claude to access any of my Zoho Creator apps and it keeps failing. I have enabled all tools for creator and ensured in claude settings that everything is authorised. Here is what claude says : Unfortunately, the error messages I'm receiving
    • Gantt Chart - Multiple Projects

      Hello, I have about 6 projects set up in Zoho and I am looking to see if it is possible to see all my projects on one gantt chart? Thanks Alex
    • milestone dependencies

      It would be exceptionally useful to be able to assign dependencies on milestone/tasks. For example, if within a project I have three milestones for creating three ads for publication, but each ad also requires the logo to be finished by the graphic designer (a separate milestone), it would be useful to have the start dates of the later items dependent on another prerequisite component. That way, not only would I not have to enter the logo creation as a separate task for each of the three milestones,
    • Need Easy Way to Update Item Prices in Bulk

      Hello Everyone, In Zoho Books, updating selling prices is taking too much time. Right now we have to either edit items one by one or do Excel export/import. It will be very useful if Zoho gives a simple option to: Select multiple items and update prices
    • Upgraded sentiment analysis model for more accurate detection

      Hello everyone! Sentiment Analysis in Zia is being upgraded to a newer model to improve how customer sentiment is detected and interpreted. This transition is aimed at getting better contextual understanding across all supported channels. As part of this
    • Notebook Al

      Why was our organisation's Notebook AI disabled, even though our admin said it wasn't done on their side?
    • Dashboard Filtering with 2 query tables using one filter field

      Hi There, I have been using user filters on the dashboard and for the most part they are fine. However I have one issue I would like to see if there is a fix for it. I have a main query that most of my widgets use. Then I have a second query for another widget. The dashboard uses the field "brand" in the main query for the filter.  The second query uses the main_query.brand field alongside fields from a second table. I have set the widget to use main_query.brand as a filter, but when the dashboard
    • How to get static reports via Desk API

      Hello, we are hoping to use the Desk API to automatically export the default static reports in Zoho Desk, or reconstruct them via other API calls. What's the best way to do this? For example, if I want to recreate the Response Time static report via the
    • What's New in Zoho POS - April 2026

      Hello everyone, Welcome to Zoho POS’s monthly update, where we share our latest feature updates, enhancements, events, and more. Let’s take a look at how April went. Access and manage other web applications in Zoho POS with Web Tabs You can now access
    • Issue with adding “Roblox” as an answer option in Zoho SurveyО

      Hello Zoho Support Team, I’m experiencing an issue while editing a survey in Zoho Survey. For some reason, I’m unable to add “Roblox” as an answer option. The same issue occurs with any answer option that contains this exact combination of letters, regardless
    • How to import MBOX to Gmail?

      In order to import or restore MBOX file backup Gmail account you can go for Advik MBOX to Gmail Import utility. This utility will import MBOX to Gmail or G Suite account without any configuration. This tool is considered as the most easiest and simplest process to perform email migration. Key Feature of this tool Import MBOX to Gmail in Bulk Maintain folder struture Retain Key elements Single Panel Interface 100% accuracy rate Download source : http://www.adviksoft.com/mbox/gmail.html
    • Free webinar! Accelerate deals with Zoho Sign for Zoho CRM and Bigin by Zoho CRM

      Hello, Paperwork shouldn’t slow you down. Whether you’re growing a small business or running a large enterprise, manual approvals and slow document turnaround can cost you time and revenue. With Zoho Sign for Zoho CRM and Bigin by Zoho CRM, you can take
    • Automatically set the default VAT percentage on a quote

      Every time I create a quote, I have to manually adjust the VAT and activate the checkbox for 21%. But all of our quotes include 21% VAT. So now occasionally, it happens that the checkbox is forgotten, and the customer receives an incorrect quote (without
    • Don't understand INVALID_REQUEST_METHOD when I try to post up an attachment

      When I make the POST request (using python requests.post() for files): https://www.zohoapis.com/crm/v8/Calls/***************01/Attachments I get this response: r:{ "code": "INVALID_REQUEST_METHOD", "details": {}, "message": "The http request method type
    • Next Page