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.
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:
You will configure a Client Script to trigger when the user edits the Price field. The script will:
Open a Flyout widget
Send the field value to the widget
Wait for a response from the widget
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
-
Go to Setup → Developer Hub → Client Script.
-
Click New Script.
-
Select the appropriate Category and Event as shown in the screenshot (Event: On Change, Field: Price).
-
Add your script code in the editor.
-
Click Save and Publish/Activate the script.
Screenshot for reference:

Code:
const WIDGET_API_NAME = "Calculator";
// Step 1: Create and configure the flyout
ZDK.Client.createFlyout('myFlyout', {
header: WIDGET_API_NAME,
animation_type: 3,
height: '400px',
width: '420px',
top: 'center',
right: '0'
});
// Step 2: Open the flyout widget and pass the Price field value
ZDK.Client.getFlyout('myFlyout').open({ api_name: WIDGET_API_NAME, type: 'widget'});
let response = ZDK.Client.getFlyout('myFlyout').notify({ data: ZDK.Page.getField('Price').getValue() }, { wait: true });
// Step 3: Close the flyout after receiving response
ZDK.Client.getFlyout('myFlyout').close();
// Step 4: Update the Price field with the response
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.