Using Zoho CRM Skill to generate Client Script

Using Zoho CRM Skill to generate Client Script


Hello everyone!

Welcome back to another exciting kaizen post.
 In the previous Kaizen, we looked at how to use Zoho CRM Skill for Zoho CRM APIs. In this Kaizen, let us look at how the skill can help you when you are working with Zoho CRM Client Scripts. Have you started exploring the Zoho CRM Skills yet? If not, check out the announcement and introductory posts to see how they can make your CRM development experience easier.

In this kaizen post,


  1. About Zoho CRM Skill
  2. How the Skill Helps with Client Script
  3. Generating Client Script using the skill
    3.1. Blocking Save When a Required Field Is Missing for a System module
    3.2. Automating Tagging and Draft Email Creation on a Custom Module
    3.3. Fetch open Deals from Accounts using COQL API 
  4. Summary
  5. Related Links


1. About Zoho CRM Skill

The zoho-crm Skill acts as an orchestration layer across, as of now, seven tools:
  1. REST API
  2. Deluge Functions
  3. Client Script
  4. Widgets
  5. COQL
  6. Queries
  7. Connections
It works through a five step flow: understand the goal, select the right primitive, load the relevant references, generate the solution, and validate the output.
It's installed via the Skills CLI or manually, and works with agents like Claude Code, Codex, Cursor, and GitHub Copilot.
2. How the Skill Helps with Client Script

The zoho-crm Skill lets you build Client Script using natural language. Describe your requirement, including the module, fields, event, conditions, and expected behavior, and it generates the script for you.
Client Scripts let you customize CRM page behavior, from field validation to auto populating data and working with related records. To write them manually you need knowledge of events, fields, ZDK methods, and syntax, and the skill removes that barrier by identifying the right event and generating the script for you.
What the skill does is figure out which event fits your requirement, and generates the corresponding script. So its output has two parts:
  1. The event details you need to configure, such as the page (Create, Detail, List), the event type (onSave, onChange, onType, onBeforeUpdate, and so on), and the field or button it applies to.
  2. The actual script for that event.

Notes
Note: It only suggests the event details and generates the code, you still configure the Client Script in Zoho CRM yourself, as of now.

3. Generating Client Script using the skill
To see how the zoho-crm skill helps with Client Script events, let us take a simple requirement first, then a more involved one that pulls together several events.

3.1. A Simple Requirement: Blocking Save When a Required Field Is Missing for a system module

Requirement : Assume that whenever a Lead is being saved, we want to make sure the Phone field is filled in. If it is empty, the save should be blocked and the user should see a message asking them to enter it.

What should you do?
Instead of looking through the Client Script documentation to recall which event fires on save and how to stop the record from being saved, you can give this requirement to an AI coding agent with the zoho-crm skill as a prompt.

Quote
Pre-requite : Install the zoho-crm skill. Refer this link to know further details.

Prompt : Using /zoho-crm block saving a Lead if the Phone field is empty and show the user a message asking them to enter it.

The script gets generated. The skill also provides steps to be followed to create the Client Script along with event details.




Follow the steps and use the script shared by the skill to accomplish the requirement. Once configured, attempting to save a Lead without a Phone number now shows the warning and keeps the record open, instead of letting an incomplete record through as shown below.


3.2. A More Involved Requirement: Automating Tag Creation and mail draft on a Custom Module

Requirement :
In a custom module named Orders with a Status field on its Detail Page (Canvas), the requirement is: whenever the Status field is changed to "Delivered," open a draft email to the customer confirming that the order has been delivered, and show a message once the draft is opened. Whenever the Status changes to "Delivered," automatically add a "Delivered" tag to the order.

What should you do?
Instead of looking through the Client Script documentation to recall which event fires on save and how to stop the record from being saved, you can give this requirement to an AI coding agent with the zoho-crm skill as prompt.


Quote
Pre-requite : Install the zoho-crm skill. Refer this link to know further details.

Prompt: Use /zoho-crm . When the Status field on an Orders record is changed to "Delivered", open the CRM email compose window in draft mode pre-filled with the subject and the body, the customer's email address is stored in the field Email_Id. At the same moment the draft opens, add the tag "Delivered" to the order record, show a toast message confirming both actions, and do a soft refresh of the detail page so the tag appears immediately.
Follow the steps shared by the skill, copy and paste the code and save the Client Script to accomplish the requirement. 



What did the skill do?
  1. Identified onBeforeUpdate as the correct event for a field change on Detail Page (Canvas).
  2. Used the correct context APIs ($Page.record_id, $Crm.user) to get the record ID and sender details.
  3. Structured the Mail model correctly (from, to, subject, content, mail_format) 
  4. Used the correct tag specific API (addTagsToRecord) 
3.3. Fetch open Deals from Accounts using COQL API

Requirement :
To get open deals of a module preferably using COQL API using Client Script.

What should you do?
Instead of looking through the Client Script and API documentation to recall which event fires on save and how to stop the record from being saved, you can give this requirement to an AI coding agent with the zoho-crm skill as prompt.

Quote
Pre-requite : Install the zoho-crm skill. Refer this link to know further details.

Prompt:  Use /zoho-crm to get open deals of a module preferably using COQL API using Client Script when the list page of Deals module is loaded.

Follow the steps shared by the skill, copy and paste the code and save the Client Script to accomplish the requirement. Note that you need to create a Connection and include that Connection name in the code.




4. Summary

In this post, we have seen how to use zoho-crm skill for Client Scripts for scenarios that involve system and custom modules.

In the upcoming weeks, we will explore more capabilities of the zoho-crm skill and see how it can help with the other developer tools available in Zoho CRM. If you have questions about the skill, Client Script events, or any of the capabilities covered in this series, feel free to drop a comment below or reach out to us at support@zohocrm.com. We would also love to hear about the use cases you are exploring with the zoho-crm skill.

5. Related Links

Have a complex scenario you would like to see solved with the skill? Drop it in the comments or write to us at support@zohocrm.com.