Kaizen# 204 - Answering Your Questions | Perform Field Updates before Blueprint transition via Client Script

Kaizen# 204 - Answering Your Questions | Perform Field Updates before 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!

    • Recent Topics

    • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

      Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
    • 🚀 WorkDrive 5.0: Evolving from a file sharing app to an intelligent content management platform: Phase 2

      Hello everyone, WorkDrive's primary focus has always been to provide an intelligent and secure content management platform, simplify collaboration, and be the central repository of files for all Zoho apps. In our previous announcement, we unveiled the
    • Join our live webinar: Explore the WorkDrive TrueSync application!

      Hello everyone, We are thrilled to invite you to a live webinar focused on mastering the WorkDrive TrueSync application. Discover how to seamlessly sync your content between the cloud and your computer, ensuring smooth and efficient file management. Our
    • Creating and managing a Team Folder using WorkDrive TrueSync

      Hello everyone, Are you tired of constantly switching between your Desktop TrueSync app and the WorkDrive web app to create and manage Team Folders? We’ve made things easier for you. You can now create and manage Team Folders directly within the TrueSync
    • Live webinar: Getting the most out of WorkDrive in Zoho Workplace

      Hello everyone, We’re excited to invite you to our upcoming live webinar, where we’ll explore how to maximize your use of WorkDrive as part of the Zoho Workplace bundle. This is a fantastic opportunity to elevate your productivity and streamline your
    • Live webinar: Mastering data migration, organization, and team collaboration

      Hello everyone, We’re excited to invite you to our upcoming live webinar! Discover how to seamlessly migrate your data, optimize file organization, and boost team collaboration using Zoho WorkDrive’s powerful features. This is a fantastic opportunity
    • Edit images seamlessly with WorkDrive's built-in Image Editor

      Are you tired of switching between multiple tools just to make simple edits to your images? We understand the hassle, which is why Zoho WorkDrive now comes with a built-in image editing tool, powered by Zoho Annotator. This tool allows you to edit images
    • Supercharge your email workflow with WorkDrive's add-in for Microsoft Outlook

      Consider this: You’re handling a critical project, and your inbox is packed with important attachments, email threads, and client communications. The back-and-forth routine of downloading files to your computer, uploading them to WorkDrive, and manually
    • Secure and promote your content with Custom Watermarking

      Imagine this: You’re a professional photographer who regularly shares your work online with potential clients and collaborators. Recently, you notice that some of your images have been reposted without any credit or permission. This not only impacts your
    • Live webinar: Explore WorkDrive's seamless integrations with key Zoho apps

      Hello everyone, We’re excited to invite you to our upcoming live webinar, where we'll delve into the seamless integration of WorkDrive with other key Zoho applications! This is a fantastic opportunity to enhance your productivity and streamline your workflows
    • Join us in Singapore for the Zoho WorkDrive User Group meetup!

      Hello, everyone! Exciting news! We'll be hosting an upcoming Zoho WorkDrive user group meetup in the beautiful city of Singapore this November. At this Zoho User Group meetup, we'll guide you through ways to use WorkDrive as a platform and build custom
    • WorkDrive TrueSync now supports ARM64-based Windows devices!

      We’re excited to announce that the Zoho WorkDrive TrueSync app now fully supports Windows devices with ARM64 architecture! Whether you're working on an ARM-based device or an x64 processor, you can now enjoy the same seamless file synchronization experience
    • Live webinar: 2024 recap of Zoho WorkDrive

      Hello everyone, We’re excited to invite you to our year-end live webinar! This session will take you through the transformative features and updates we’ve introduced in Zoho WorkDrive this year, helping you streamline document management like never before.
    • Option to Disable Download for Documents Shared via Permalink

      Dear Zoho Writer Team, Currently, when sharing a Writer document using the regular permalink (Collaborators with external users), there is no option to restrict the ability to download the document. While the external share link allows such restrictions,
    • Live Webinar: Optimizing back-office operations in the manufacturing industry to maximize profitability

      Hello everyone, We’re excited to invite you to our upcoming live webinar on February 6! Discover how Zoho WorkDrive can help manufacturing businesses optimize back-office operations, improve efficiency, and boost profitability. Our product experts will
    • Important update for WorkDrive TrueSync users in China Data Center (CN DC) & Chinese language users in other DCs

      Dear WorkDrive TrueSync users, We recently identified an issue affecting users who have set their WorkDrive TrueSync app language to Chinese (Simplified/Traditional). During the auto-update process, the app would not restart automatically and unexpectedly
    • Live webinar: Streamlining legal operations: Leveraging Zoho WorkDrive for law firm success

      Hello everyone, Managing legal documents across departments and jurisdictions can be complex, but it doesn’t have to be. Join us on March 6 for an exclusive webinar where we’ll show you how Zoho WorkDrive empowers legal teams to stay compliant, organized,
    • Calendar not working

      Are we the only ones. On any browser we cannot click on any of our calendar appointments and get them to open. They just make the browser loop. WE have reached out and have been told they are working on it. The office staff are really stuck. The point
    • [Live Webinar] New in Zoho WorkDrive: AI enhancements, Data Loss Prevention, Version Controls, and more

      Hello everyone, We're excited to bring you another round of powerful updates in Zoho WorkDrive! Join us on May 15 for an exclusive live webinar where we’ll unveil the latest features designed to enhance your team’s productivity, collaboration, and data
    • How to Download a File from Zoho WorkDrive Using a Public Link

      How to Download a File from Zoho WorkDrive Using a Public Link If you're working with Zoho WorkDrive and want to download a file using a public link, here's a simple method to do so using API or a basic script. This approach helps developers or teams
    • WorkDrive TrueSync for macOS 26 (Tahoe) Beta

      Hello everyone, With Apple unveiling the macOS 26 (Tahoe) Beta, we know many of you are eager to explore the latest features and enhancements. We’re excited to support your enthusiasm! As part of our commitment to delivering seamless cross-platform experiences,
    • domain not verified error

      Hi when i try to upload a video from zoho creator widget to zoho work drive iam getting domain not verified error.I don't know what to do .In zoho api console this is my home page url https://creatorapp.zoho.com/ and this is my redirect url:www.google.com.Iam
    • Live Webinar: Getting Started with Zoho WorkDrive - A Complete Overview

      Hello everyone, We’re excited to invite you to our upcoming live webinar! Discover how to set up your team, bring in your data, and make the most of WorkDrive’s collaboration, organization, AI, and security capabilities. This session is perfect for anyone
    • Calendly One-way sync- Beta Access

      Hello Community, Many of our Zoho Calendar users have expressed their interests in Zoho Calendar and Calendly integration. We've been tightly working on with Calendly team to provide a two-way sync between Calendly and Zoho Calendar. However, there have
    • The year that was at Zoho Calendar 2023- Part 2

      In continuation with our previous post on all the exciting updates and improvements that have shaped Zoho Calendar over the past 12 months, Lets delve into more: Bring your calendars together- Introducing Zoho Calendar and Outlook calendar synchronisation
    • Tip of the week #18: Change the event organizer in Zoho Calendar.

      We cannot always be available to conduct an event when we organise one. In these circumstances, you can use Zoho Calendar to change the event organizer at any moment before the event begins. This way, you can avoid cancelling the event while still taking
    • Tip of the week #20: Create and manage multiple personal calendars.

      Zoho Calendar provides users with the facility to create and manage as many calendars as required. All these calendars can be managed and edited as per user requirements. You can alter the calendar view, make changes to the calendar theme, share the calendar
    • Tip of the week #24: Subscribe to the calendars of a Zoho Calendar user.

      Calendars that are created by Zoho Calendar users can also be added to your Zoho calendar. All public calendars listed by the users will be available when you enter the email address. You can choose the calendar you need to subscribe to. Once the email
    • Tip of the week #26: Import/ Export calendars in Zoho Calendar.

      Any calendar on the web or calendars that you create in any other calendar application can be imported in to Zoho Calendar. This will help you to add the events from the calendars that you import to your Zoho Calendar. You also have the option to export
    • Removing calendar for zoho email group

      How do I make it so that an email group created in Zoho Mail does NOT have a calendar? I have a couple groups for our phone systems voicemails - one for each department. Voicemail recordings are sent to this groups email address so they have access to
    • Tip of the week #27: Edit personal calendars in Zoho Calendar.

      In Zoho Calendar, the personal calendars you create can be edited to make changes you need to make. Edit a Personal Calendar The following changes can be made to the personal calendar by editing it: Calendar title Calendar color Reminders and Description
    • Tip of the week #28: Show/ hide, enable/ disable and empty/ delete your calendars in Zoho Calendar.

      The popularity of online calendars has soared in recent years. It's used both for personal and professional reasons. Calendars have evolved into an effective productivity tool in our lives, from creating events for birthdays and anniversaries to scheduling
    • Tip of the week #30: Share calendars publicly in Zoho Calendar.

      In Zoho Calendar, calendars that are created under My Calendars can be shared publicly. Making your calendar public allows others to view it. When you need to share your calendar with a larger group, public sharing can help. You can restrict others from
    • Tip of the week #31: Share your personal calendars within organization.

      Keep your Organization members aware of what's happening. In Zoho Calendar, you can share your personal calendar with all the members in your organization using the Share with org option.When you enable org sharing for a particular personal calendar,
    • Tip of the Week #33: Appointment scheduler in Zoho Calendar.

      In Zoho Calendar, you can use the Schedule Appointment option to share your appointment request form with the public, allowing people to fill out the form to request an appointment with you. This form can be embedded on your website or blog. Visitors
    • Tip of the Week #34: Embed Calendars using Zoho Calendar

      You can make your calendars public and visible to the general public by embedding them in your websites/blogs using Zoho Calendar. You can use the embed code to add your own calendars to your website's/ blog's HTML code, and the calendar will appear on
    • Tip of the week #35: Migrate to Zoho Calendar from Google Calendar.

      If you are looking to move your Google Calendar events to Zoho Calendar, never worry about missing out the events from your Google Calendar. You can migrate the events from Google Calendar using the export option and import it to Zoho Calendar and manage
    • Tip of the week #36: Migrate to Zoho Calendar from Outlook Calendar.

      If you've been using Outlook calendar and looking to migrate to Zoho Calendar, you can seamlessly export your calendars from Outlook and import them into Zoho Calendar without losing any events, participants, and the reminders set for each event. To migrate
    • Shared calendar issues and duplications

      Apparently there was a calendar update?  Now when I schedule an event for a team member that has shared his calendar with me, the event makes me the organizer and adds the event to my calendar as well.  Previous to this "update" I would scheduled an event
    • Subscribed Calendar

      Hi i have subscribed to a calendar for Holidays in Canada it shows all the holidays perfectly but every one of them has the word Canada before the rest of the name is there a way to remove that word Canada? It takes up a lot of space in the square on
    • Next Page