Trigger Flyout Widget in Zoho CRM using Client Script for real time field updates

Launch and Sync a Custom Widget in Flyout Mode Using Client Script in Zoho CRM

Summary:

This article explains how to launch a custom widget as a flyout in Zoho CRM using Client Script, pass data from a CRM field to the widget, and update the same field based on the widget’s response.

Requirement Overview: 

Certain use cases require custom interactions when a user edits a field in Zoho CRM.9 For example, launching a calculator or custom logic interface without navigating away from the record. By using a Client Script with flyout configuration, you can open widgets in a dedicated pane (flyout), pass data from the CRM record, and update fields based on the widget’s output.

Deploy Client Script in Zoho CRM:  

  1. You will configure a Client Script to trigger when the user edits the Price field. The script will:
  2. Open a Flyout widget
  3. Send the field value to the widget
  4. Wait for a response from the widget
  5. Update the Price field with the returned value

Use Case  

Scenario:

When a user edits the Price field, a calculator widget opens as a Flyout. The field’s value is passed to the widget for computation. Once a new value is calculated in the widget, it sends the result back to the Client Script, which then updates the same field in CRM.


Configuration:

Client Script – Create and Handle Flyout  

Create a Client Script and run it on change of the Price field
  1. Go to Setup → Developer Hub → Client Script.
  2. Click New Script.
  3. Select the appropriate Category and Event as shown in the screenshot (Event: On Change, Field: Price).
  4. Add your script code in the editor.
  5. Click Save and Publish/Activate the script.
Screenshot for reference:



Code:

  1. const WIDGET_API_NAME = "Calculator";

  2. // Step 1: Create and configure the flyout
  3. ZDK.Client.createFlyout('myFlyout', {
  4.   header: WIDGET_API_NAME,
  5.   animation_type: 3,
  6.   height: '400px',
  7.   width: '420px',
  8.   top: 'center',
  9.   right: '0'
  10. });

  11. // Step 2: Open the flyout widget and pass the Price field value
  12. ZDK.Client.getFlyout('myFlyout').open({ api_name: WIDGET_API_NAME, type: 'widget'});

  13. let response = ZDK.Client.getFlyout('myFlyout').notify({ data: ZDK.Page.getField('Price').getValue() },  { wait: true });

  14. // Step 3: Close the flyout after receiving response
  15. ZDK.Client.getFlyout('myFlyout').close();

  16. // Step 4: Update the Price field with the response
  17. ZDK.Page.getField('Price').setValue(response.incrementedNumber);



In the widget code, register the following event listener to wait for the flyout and receive data from the client script.

  1. ZOHO.embeddedApp.on("NotifyAndWait", function (data) {
  2.   console.log("Client Script synchronous flyout notification", data);
  3.   console.log("Data received:", data.data);

  4.   // Store the incoming data (e.g., original price)
  5.   result.value = data.data.data;

  6.   // Save the Flyout ID for sending the response back
  7.   FLYOUT_ID = data.id;
  8. }

To send a response back from your widget to the Client Script, you can use the Zoho CRM JS SDK method:

  1. ZDK.Client.sendResponse(FLYOUT_ID, {
  2.   incrementedNumber: result.value  // Replace with actual computed result
  3. });

In the widget UI, add a “Send Result” button that, on click, computes the value and calls the SDK method to return it to the Client Script.



Example Workflow
  1. User edits the Price field.
  2. The Client Script opens the Calculator widget as a flyout.
  3. The widget receives the original price and performs the calculation.
  4. Upon clicking “Send,” the widget returns the computed value.
  5. The Price field is updated automatically with the new value.


Working demo: 



 
The source code for the widget used in the example above is available here.



Related Links  
QuoteCustom Solution Created by Francis (Vishnu) | Zoho Partner Support

If you need any further clarifications, please don’t hesitate to contact partner-support@zohocorp.com.

Additionally, we kindly ask all "Europe and UK partners" to reach out to partner-support@eu.zohocorp.com.


      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              WCAG



                                        Create. Review. Publish.

                                        Write, edit, collaborate on, and publish documents to different content management platforms.

                                        Get Started Now







                                                          You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                              Manage your brands on social media


                                                                • Desk Community Learning Series


                                                                • Digest


                                                                • Functions


                                                                • Meetups


                                                                • Kbase


                                                                • Resources


                                                                • Glossary


                                                                • Desk Marketplace


                                                                • MVP Corner


                                                                • Word of the Day


                                                                • Ask the Experts


                                                                  Zoho Sheet Resources

                                                                   

                                                                      Zoho Forms Resources


                                                                        Secure your business
                                                                        communication with Zoho Mail


                                                                        Mail on the move with
                                                                        Zoho Mail mobile application

                                                                          Stay on top of your schedule
                                                                          at all times


                                                                          Carry your calendar with you
                                                                          Anytime, anywhere




                                                                                Zoho Sign Resources

                                                                                  Sign, Paperless!

                                                                                  Sign and send business documents on the go!

                                                                                  Get Started Now




                                                                                          Zoho TeamInbox Resources





                                                                                                    Zoho DataPrep Demo

                                                                                                    Get a personalized demo or POC

                                                                                                    REGISTER NOW


                                                                                                      Design. Discuss. Deliver.

                                                                                                      Create visually engaging stories with Zoho Show.

                                                                                                      Get Started Now









                                                                                                                            Wherever you are is as good as
                                                                                                                            your workplace

                                                                                                                              Resources

                                                                                                                              Videos

                                                                                                                              Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                              eBooks

                                                                                                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                              Webinars

                                                                                                                              Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                              CRM Tips

                                                                                                                              Make the most of Zoho CRM with these useful tips.



                                                                                                                                Zoho Show Resources