Perform Field Updates during Blueprint transition via Client Script

Perform Field Updates during Blueprint transition via Client Script



Hello everyone!

Welcome back to another exciting Kaizen post.
One of the questions we received through your Kaizen feedback was: 

“How can I update fields before Blueprint transition and how to prevent a transition based on a condition using Client Script?”

 In today’s post, let’s walk through how to achieve this with a simple real-world example. 
We have previously explored how to use Blueprint Events in this Kaizen post and how to implement custom validations within a Blueprint in another Kaizen post.
In this Kaizen post, 


In this Kaizen post, 

1. Use Case
        A. Field Update during Blueprint Transition
        B. Prevent Transition
2. Solution
3. Summary
4. Related Links



1. Use Case

Lisa, the CRM Admin at Zylker, wants to enhance the Lead follow-up Blueprint by capturing the reason behind each transition. Before any transition, a popup should prompt the user to enter a comment.

Field Update:
The Description field should act as the comment history for all Blueprint transitions. When a user enters a comment during a transition, the system should append the comment along with the transition name and the user’s name to this field if the comment has more than 25 characters.

Prevent Transition:
If the comment is less than 25 characters, the transition should be prevented.

2. Solution: 

  • To achieve this, you should create a Client Script that runs during the beforeTransition Blueprint event in your Blueprint.
  • The Before Transition event allows you to control what happens just before a Blueprint transition is executed, and this is perfect for tasks like validating inputs or updating fields dynamically.
  • Go to Setup > Developer Space > Client Script. 
  • Click +New Script.
  • Specify the details to create a script and click Next.
  • Enter the following script and click Save.

  1. // Show a popup input asking the user to enter comments
  2. var notes_pop_up = ZDK.Client.getInput(
  3.     [{ type: 'text', label: 'Comments' }], // Input type and label
  4.     'Deal',                                // Title of the popup
  5.     'OK',                                  // Confirm button text
  6.     'Cancel'                               // Cancel button text
  7. );

  8. // Get the "Description" field from the current record
  9. var notes_field = ZDK.Page.getField("Description");

  10. // Check if the input comment length is greater than 25 characters
  11. if (notes_pop_up.length > 25) {

  12.     // If the Blueprint transition is "Gather Details", create a new description with just this comment
  13.     if (transition.name == "Gather Details") {
  14.         var desc = transition.name + "- " + notes_pop_up + ",";
  15.     } 
  16.     // For other transitions, append the new comment to the existing description along with the user name
  17.     else {
  18.         var desc = notes_field.getValue() + " ,\n '" + transition.name + "' - " + notes_pop_up + " - " + $Crm.user.full_name;
  19.     }

  20.     // Fetch the Lead record using the record ID from the page
  21.     var lead = ZDK.Apps.CRM.Leads.fetchById($Page.record_id);

  22.     // Update the Description field of the lead
  23.     lead.Description = desc;

  24.     // Save the updated lead record
  25.     var response = ZDK.Apps.CRM.Leads.updateById(lead, $Page.record_id);

  26. // If comment length is less than or equal to 25 characters, prevent the transition
  27. else {
  28.     ZDK.Client.showAlert("Enter minimum of 25 characters to proceed");
  29.     return false; // Block transition
  30. }

  • To prompt the user for comments during a Blueprint transition, use ZDK.Client.getInput(), which displays a popup input box.
  • The existing value of the Description field can be fetched using ZDK.Page.getField("Description").
  • To retrieve full lead details based on the current record, call ZDK.Apps.CRM.Leads.fetchById() using $Page.record_id.
  • Once the new comment is prepared, update the lead by calling ZDK.Apps.CRM.Leads.updateById().
  • If the entered comment is too short (e.g., under 25 characters), the code displays an alert using ZDK.Client.showAlert() to guide the user.
  • The user’s full name is accessed via $Crm.user.full_name.
  • Finally, return false will stop the Blueprint transition if the number of characters is less than 25.
  • Here is how the Client Script works if the user specifies a description with sufficient length.


  • As you can see in the following gif, if the user enters a short description, the Client Script shows an alert and prevents the Blueprint transition.



We hope you found this post useful. We will meet you next week with another interesting topic!
If you have any questions, let us know in the comment section.
Click here for more details on Client Script in Zoho CRM.

3. Summary

A. How can I update fields during a Blueprint transition using Client Script
B. How to prevent Blueprint transition

4. Related Links

Best practices of Client Script 

Happy Client Scripting!

    • Sticky Posts

    • Kaizen #197: Frequently Asked Questions on GraphQL APIs

      🎊 Nearing 200th Kaizen Post – We want to hear from you! 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 #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.
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! 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.
    • Client Script | Update - Introducing Commands in Client Script!

      Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands
    • Recent Topics

    • A Question about Email Handling (Sending and Receiving)

      Hello! I was looking into setting up Email Aliases for my domain that I purchased a while ago through Zoho Mail. I set up a singular alias already and have it linked with Gmail, and it seems to be working out well. However, I set up another alias today,
    • Kaizen #201 - Answering Your Questions | Webhooks, Functions, and Schedules

      Hello everyone! Welcome back to another post in the Kaizen series! We are incredibly grateful for all the feedback we received, and as promised, we will answer all the queries in this Kaizen series. Last week, in our 200th post, we addressed one of the
    • Zoho Projects Strict Dates for Tasks

      Hi Zoho Projects team, I would love to see a feature to allow Strict Dates for Tasks. Sometimes in projects you have dates which must not move, even if predecessor Task dates change. For example, perhaps you need to book access to a facility to perform
    • No Mark as filed buton in GSTR -3b

      We are filing our GST in GST portal -and want to mark GST in Zoho books as filed. It is possible to mark GSTR 1 as filed through Mark as filed button. But there is no such button in GSTR-3B.  How to mark corrosponding GSTR-3B as filed?
    • ranking by drag the choices instead of rank by number

      is the option of draging the choice is available instead of selecting the ranking number for each choice?
    • TASKS - Dashboard to show ALL Tasks from ALL apps.

      The Unified Tasks View is useless without the other main zoho apps (Desk, Books & even FSM now) We need to see all our tasks under on pane of glass. The Zoho developers are out of touch with real business workflows. So how it was designed they want us
    • Function #13: Transaction level profitability

      In Zoho Books, the Profit & Loss report provides valuable insights into the overall profitability of your business, indicating whether you have made a profit or incurred a loss. However, there may be occasions when you wish to assess whether a specific
    • Zoho CRM with Sap Business One

      I need information about integration CRM with Sap BO, thank.
    • Allow bill to nest multiple projects

      A bill (purchase) is more often than not used across multiple projects and this functionality is missing and very urgently needed for accurate reporting of purchases across projects
    • Amazon invoice in Zoho Books

      I have just made my first few sales on Amazon India. Amazon Seller account generates invoices for the sales made on Amazon. These invoices are sent to customers also. Now when I was only making offline sales, I used to create Invoices in Zoho Book. Now
    • How can I change iOS display setting at night?

      It seems like at night the two light daytime settings themes (white with blue on top or just white) are not available and I am forced to choose among a few other colours that I really don’t want, I.e., black, blue or orange. Is there a way for me to always
    • Celebrate WWW day with Zoho Desk

      Let's recall the times when we learned 'WWW' stands for World Wide Web. Whether you like to call it wuh-wuh-wuh or double-u double-u double-u, or World Wide Web, we all owe a lot to this groundbreaking invention that reshaped how we connect, communicate,
    • The power of camaraderie

      In the days before the internet boom, conversations happened face-to-face or over the phone. Phone calls were precious; every minute counted, and every word mattered. We looked forward to those moments of real connection. Even today, nothing quite matches
    • Message Content is missing/invalid fault

      We cannot create a complete template over zoho. Some features - like button adding - is missing. The templates are created on Zoho and edited on Meta to solve the problem. But still then, some features cannot be used and the message returns this failure
    • Können bereits gesendete Kampagnen im Nachhinein einer Mailing-Liste zugeordnet werden, ohne dass die Kampagne erneut versendet wird?

      Wir haben unsere älteren Kampagnen in Campaigns über Kontaktkategorien versendet. Dann haben wir umgestellt auf Mailing-Listen, damit alte Kampagnen auch in einem Archiv aufgerufen werden können. Jetzt ist die Frage, ob die Kampagnen, die über die Kategorieauswahl
    • Newsletter Templates Are Not Mobile Responsive

      Hi, I've already submitted this request to ZOHO once this morning, but for some reason your system logged me out, wouldn't accept my username/password login, and isn't showing any evidence that I've submitted this issue. So here we go again... I am under the impression that your newsletter templates are supposed to be mobile optimised: https://www.zoho.com/campaigns/blog/responsive-email-marketing.html This is clearly not the case, as the last 2 newsletters I've created in Campaigns look perfect
    • Digest Juillet - Un résumé de ce qui s'est passé le mois dernier sur Community

      Bonjour à toutes et à tous, Zoom sur les nouveautés de juillet dernier au sein de Zoho Community France. Zoho Commerce vous propose une expérience améliorée grâce à sa nouvelle interface ergonomique et à ses fonctionnalités avancées, conçues pour faciliter
    • 100 Rows in a Subform is too limited

      We have a custom Module in CRM called Price Sheets, when we get a PO from a client we add the items from the PO to it and then check with our vendors for pricing and add our margin etc And after it is complete we have setup custom scripts to create a
    • Uninstall unattended agent

      Hello, I'm testing many use case before we purchase assist for our remote support. While we are testing what is the proper way to uninstall agent?  I did uninstall from systray, from windows control panel but still ZohoURservice is running. How can I uninstall client side?
    • Zoho Commerce Down?

      Is anyone else's storefront down at the moment? Ours has been down for at lease an hour.
    • Zoho Projects iOS app update: Dashboard widget on the home screen

      Hello everyone! We are excited to introduce the 'Dashboard' widget in the latest version(v3.10.8) of the Zoho Projects iOS app. Dashboard widgets allow you to view the project progress visually without having to open the app. The widget enables you to
    • Idea: Workflow Rule Trigger Only When Subform Row Is Updated (Thanks to New Inline Row Feature)

      Hi Zoho team and community, With the recent update to Zoho CRM, we can now add or delete rows inside subforms without entering edit mode, using the inline Add row button. This is a fantastic improvement for user experience — seamless, fast, and efficient.
    • Auto add new section based on document choices

      Hi team, I'm wondering if the below is a possilibity within Zoho sign. We have an application process to become a customer of ours, we currently use Zoho Sign to manage this application and this works quite well. However, if the customer indicates 'YES'
    • Change rate after xxxx kilometers

      Is there a way to change the miileage rate after a certain mileage. After 5000 kilometers, we want the rate to automaticly change. Thank !
    • Subform Entry Limit from a Subform Field (A different Subform on the same Form)

      Hi, I would like to be able to use a Subform 1 Field as the Dynamic Entry Limit for Subform 2. Even better would be able to use some code with the values, so for example using the Subform 1 Qty Field as the Max Entry limit for Subform 2, BUT only the
    • Slow Zobot response time

      Hi, We launched the Zobot on our site to sit along with the regular Live Chat but had to take the Zobot down as the response time was very slow. The bot was slow to begin then once the chat had been initiated the response was very slow. The bot typing
    • how to show data of 3 table in pivot

      Based on engineer name i want to get the data from 3 different tables like Service , amc, installation , but Every table contain Engineer name As Common , based that from the service table i want to take service amount , and count of service based on
    • Custom Status for Purchase Orders

      Currently Zoho books has functionality to create custom statuses for Sales Orders. Can this be extended to include custom status for purchase orders as well? It was a great decision to add this functionality to sales orders. Our use case is for tracking
    • Ask the Experts 22: Scale up your customer support with integrations & extensibility

      Hello everyone! The foundation is set. Build the beams. Raise the pillars. Set the walls. The Zoho Desk architecture stands tall. Let's discuss integration within Zoho Desk, extensions from the Marketplace, creating connections between Zoho Desk and other
    • Is there no way to duplicate an entire workflow or even custom function across multiple departments?

      Is there no way to duplicate an entire workflow or even a custom function from one department to other departments, like it is done for field duplication from one department layout to other department layouts?
    • Automated reply on any new ticket raised by customer

      Hi ZohoDesk team, Can we set up an automation so that whenever a new ticket is created against our support email; ZohoDesk immediately sends our standard acknowledgement, including the expected TAT for resolution? If that’s possible, could you share the
    • Zoho equipment rental - just like Booqable

      Hi Zoho Team, is it possible to create a module or a system like booqable? our business starts renting our IT equipment assets that have been recently used for Events and Projects, we are having ZOHO books so its easy to integrate if you create one. Booqable
    • Profit Margin Scheme

      I'm a tourism company operating in the aviation and outbound tourism sectors. Typically, taxes are 0% as our operations are outside the country. However, the state has now imposed a tax on the profit margin. This means if the selling price of an airline
    • Visibility and Enforcement for Outdated Plug Parameters in Zobot Canvas

      Dear Zoho SalesIQ Team, Greetings, We’d like to suggest an important usability and quality improvement for working with Plugs inside Zobot. Current Behavior: When we update the code of an existing Plug, any Zobot card using that Plug requires manual resaving.
    • Announcement: Zoho DataPrep to Deprecate Password-Only Authentication for Snowflake Connections on July 31, 2025

      As part of our ongoing commitment to security and in alignment with Snowflake's pledge to the Cybersecurity and Infrastructure Security Agency (CISA) Secure by Design initiative, Zoho DataPrep will no longer support single-factor password authentication.
    • The same Contact associated to multiple Companies - Deals

      Hi, I would like to know if there is an option to associate the same contact with multiple companies (two or more) deals, using the same contact details for all. This is because we have contacts who are linked to different companies or branches of the
    • Text on Zoho Sign confirmation dialouge is very small compared to text used everywhere else on Zoho Sign.

      I've reported multiple times through Zoho's support email that the text on this notification is very small in contrast to all the other text on the Zoho Sign app. I think it's a bug and it just needs the font size to be increased. It's very minor but
    • Wise integration in Zoho Books

      Hi, it is now time for zoho books to support Wise.com integration for payment links. Wise has launched credit card payments, now about 0.5% cheaper than Stripe. Also their bank payments are much much cheaper than credit cards. Its time for books team
    • Error Message: None of the rows can be imported

      I have been using zoho sheets to download my CSV file for about 2 years now, this month, October 2021, for some reason when I download it to upload to zoho books I get a message saying "None of the rows can be imported". I have been using the same process,
    • Invalid Element place_of_contact, Invalid Element gst_no, Invalid Element gst_treatment

      so this is the body contact_name: orderData.customerName, company_name: orderData.customerName, email: orderData.email, contact_type: 'customer', currency_code: 'INR', gst_treatment: 'business_gst', gst_no: 'i using proper gst no i just removed it from
    • Next Page