Overview

Client Scripting for Zoho CRM

What is a Client Script?

Client script is a piece of JavaScript code that runs on your web browser instead of the server, thus returning an immediate response. Using the Client script, you can perform event-triggered UI actions on the client-side. For example, when a user fills the email address of a Lead/Contact, you can perform email discovery and automatically populate relevant data in the form.
Likewise, you can implement highly interactive and responsive interfaces using JavaScript to cater to your business needs. It runs seamlessly on your browsers and encompasses hassle-free rich set of Client APIs to customize the UI, execute the underneath Zoho CRM APIs and the necessary serverless functions.

Pre-requisites

  • The client script feature is available in Enterprise and Ultimate editions of Zoho CRM.

  • Refer to this page for the supported browser versions.

Note:

  • Using the client script, you can handle only the UI on the client-side.

Events and Actions

A client script has two primary components, namely:

  • Events: The client script gets executed when an associated event is triggered in the client.
  • Actions: You can perform client-side actions using ZDK. There are various helpers available in ZDK, which you can use to perform client operations, hit APIs, and call functions.

Application events

Application events are triggered from inside the Zoho CRM application. The event can be triggered either from a page or field.

  1. Page events - These are the events that occur on a specific page in Zoho CRM. It can be a create page, clone page, or an edit page of a module. For instance,

    • onLoad - The system automatically runs the client script when a page(create/clone/edit) gets loaded. For instance, you can load the address details of a lead, in the create lead page, based on the territory of the current user.

    • onChange - The system automatically runs the client script when you update any field in the page.

    • onSave - The system automatically runs the client script when you save a record. For instance, you can display the score points of the current user, when a contact is saved.

  2. Field events - These are the events that occur in a specific field in Zoho CRM.

    • onChange - The system automatically runs the client script when you update a specific field. For instance, you can update the scale of a company based on the entry in the number of employees field.

Actions

Some of the sample page actions you can achieve using client script are:

  • Read and write data in any type of field on the current page. For instance, you can load the address details of a lead, in the create lead page, based on the territory that the current user belongs to.

  • Show error/alert/warning/info messages in the native style of the application. For instance, you can throw an error message when the input given for a custom field is invalid.

  • Freeze or unfreeze a page. For instance, you can freeze a page(create/clone/edit) until an internal process is complete.

  • Display inline error messages for a field. For instance, you can display an inline error message if the pin code entered is invalid.

  • Mark a field as mandatory and convey it through a text.

Use cases of Client Script

  • Auto-populate field data while creating or editing a record. Example: Auto-updating the state or county field when a user enters the pin code.

  • Apply advanced formula computation to the fields. Example: Calculating and updating the age of a person based on the birth date entered in a form.

  • Achieve field validation, auto-correction, and data enrichment. Example: Automatically detecting whether the card is a VISA or Master Card.

  • Display custom error messages for a specific set of users or fields. Example: Throwing an error when the user enters a personal email ID in the organization email ID field.

  • Compare the unsaved code with previously saved code of a client script using the Review option

  • Access and activate any of the previously saved revisions of code (up to 30 revisions can be saved) using Revisions option.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocrm.com