Kaizen 264 - Using zoho-crm Skill to Write Functions

Kaizen 264 - Using zoho-crm Skill to Write Functions



Hello CRM wizards,

Welcome back to another week of Kaizen.

In our previous Kaizens, we explored how the zoho-crm skill can assist you across various Zoho CRM developer tools. This time, let us see how it can help you write Deluge Functions, from simple workflow automations to complex integrations with third-party services. 

Since Deluge is a Zoho's exclusive scripting language, let's put the skill to test with three use cases of increasing complexity. We'll start with a basic field update, move on to querying CRM data, and finally explore an integration with Zoho Books. 

If you are starting new with the skill, check out Kaizen #258 on Getting Started with zoho-crm skill for more information.

Case 1: Automating a Simple Field Update

Let's start with a straightforward use case. 

Prompt 

Quote/zoho-crm Whenver the Phone field of a lead is populated or updated, automatically copy its value to the Mobile field.

Response



The skill identifies the appropriate approach which is a function triggered by a workflow rule. It generates Deluge code and provides the steps needed to put the solution into action. This includes instructions for creating the workflow rule, configuring its trigger and mapping the function arguments to the relevant fields. 

As a result, you get more than just a code snippet. The skill also guides you through the CRM configuration needed to make the function work. 

Info
Watch all the videos till the end to see the generated code in action.

Case 2: Identifying and Updating Stale Leads Using COQL

Now that we have covered a basic automation, let's introduce a little more complexity. This time, we'll use COQL to query CRM records and update them based on specific conditions. 

Prompt

Quote/zoho-crm Identify stale leads in Zoho CRM that have had no meaningful activity for more than 30 days and update their custom Lead Health field to “Stale”.

Response



Notice how the skill asks for additional information when the initial prompt doesn't provide enough details to implement the solution. Once the requirements are clarified, it generates the function code to indentify stale leads and update their Lead Health field.

It also guides you through the setup required to run the function, including creating a connection with the appropriate OAuth scopes and configuring a schedule. Before running the function, it recommends verifying that the field names and other details in the generated code match your CRM setup. 

There's another useful detail to look out for, which is the error handling. The generated code includes a failure-handling path that sends an email to the logged-in user if it cannot update a lead's health status. This helps notify the user when something goes wrong, making troubleshooting easier. 

You can also explicitly mention error handling in your prompts, and the skill can incorporate it into the generated code.

Notes
The skill generated codes are available on our github for your reference. 

Case 3: Creating Zoho Books Invoices from Zoho CRM

Let us take things up a notch and explore a use case involving third-party APIs. 

Prompt

Quote
/zoho-crm Need to create an invoice in Zoho Books when a Deal in Zoho CRM is closed with a stage Closed Won and save the invoice ID from the API response in the Deal's Invoice custom field.

1. Fetch the Deal's Stage, Account ID
2. Make a Related Records call and find the associated Quotes ID
3. Fetch the line items from the Quotes
4. Using the account ID find the Zoho Books customer ID
5. Create an invoice with the customer ID and line items
6. Update the invoice ID in the deal's Invoice field

connection link name : books_oauth_connection
Books Org ID: 131786026

Response



In this scenario, the function integrates Zoho CRM with Zoho Books to automate invoice creation for closed-won deals. The workflow involves retrieving the relevant CRM details, identifying the corresponding customer in Zoho Books, and using the required information to create an invoice. 

Unlike the previous examples, much of the function's logic depends on the responses returned by earlier API calls. The function must process those responses extract the necessary details and pass them to subsequent API requests. 

For complex use cases, the more context you provide, the better the skill can tailor the solution to your requirements. Describing the expected code flow, the sequence of API calls and the data to be passed between them can help reduce the need for multiple iterations. 

You can also refer the skill to relevant third-party API documentation help pages when you need it to follow specific API requirements. 

Notes
Note

The key is to start with a clear requirement, provide additional context when needed, and review and test the generated code before deploying it. The skill can help with both the implementation and the steps required to configure the function in Zoho CRM. 
We hope you find this kaizen helpful.

Have questions or suggestions? Drop them in the comments or write to us at support@zohocrm.com.

On to Better Building!

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Idea
Previous Kaizen: Using Zoho CRM Skill to Build Widgets | Kaizen Collection: Home
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    • Sticky Posts

    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Kaizen #261 : Using Zoho CRM Skill to generate complex COQL queries

      Hello everyone, In the previous Kaizen posts, we introduced the zoho-crm SKILL.md and discussed how it can help you when you are working with Zoho CRM APIs and Client Script. In this Kaizen, we will focus on using the Zoho CRM `SKILL.md` with GitHub Copilot
    • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

      Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Kaizen #226: Using ZRC in Client Script

      Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
      • Recent Topics

      • I want to test some payment subscription with a test credit card from stripe

        I have a test customer and place https://stripe.com/docs/testing#international-cards test credit card number to the Add New Card in subscription.zoho customer page. After I added, the test card was declined. Am I missing something?
      • Trigger a Workflow Function if an Attachment (Related List) has been added

        Hello, I have a Case Module with a related list which is Attachment. I want to trigger a workflow if I added an attachment. I've seen some topics about this in zoho community that was posted few months ago and based on the answers, there is no trigger
      • Strengthen your account security with Password Policy

        Still using the same password for all your accounts? Or perhaps your password is easy to guess or follows a predictable pattern? If so, your account could be at risk. Once someone gets hold of a password that you reuse, they could potentially gain access
      • Expanding sales, marketing, and support capabilities in Zoho CRM Plus 3.0

        Hey everyone, It's been more than 10 years since we launched Zoho CRM Plus back in 2014. This is quite a milestone, and we've come a long way in empowering you with everything you need to offer an exceptional customer experience. On that note, we expanded
      • Messages do not open and I cannot reply to messages in Zohodesk

        Hi, this is an unusual behaviour. I cannot reply to messages: Accessing a draft message - runs endlessly. Sending Emails fail:
      • Zoho CRM calendar merge with outlook

        Hi Zoho team! I did the steps for syncing the zoho CRM calendar with outlook. Everything works well as long as the user creates meetings inside the newly created Zoho CRM calendar in outlook, but I need a way to also display the meetings which are received
      • Introducing PRM: Build, manage, and scale your partner ecosystem

        Growing a partner ecosystem is a good problem to have. What starts as a handful of partners can quickly turn into a maze of spreadsheets, emails, and disconnected processes. More partners mean more opportunities, greater reach, and new ways to grow
      • Duplicate Record Creation

        Hello Team, I would like to check whether there are any options available in Zoho FSM to prevent duplicate record creation in the following modules: Assets Companies Contacts Ideally, we would like the system to check for existing records before allowing
      • Live connection to DS files in Zoho Creator / ChatGPT

        As an idea, we are using ChatGPT to build with Zoho Creator (outside of Zia), which is works brilliantly to assist write deluge, provide test suggesitons etc. Currently we are uploading the DS files which are very point in time, it would be great to have
      • Zoho Forms - Feature Request - Embed iFrame or Dynaic URLs in Description fields

        Hi Zoho Forms team, I'm working with a client who uses Zoho Forms internally to collect information over the phone from potential work placement candidates. At the end of the form, the candidate needs to be booked in for an induction, which we've configured
      • New in Office Integrator: Add text, diagrams, and drawings to your spreadsheet

        Hi users, We are pleased to introduce the Shapes feature in Zoho Office Integrator's spreadsheet editor. It lets users create visual elements; including simple shapes, text boxes, freehand drawings, and structured diagrams; directly within the spreadsheet.
      • Highlight what matters, erase what doesn’t in PDFs

        When reviewing PDFs or preparing them for sharing, two things often come up: you want to draw attention to what’s important, and you want to hide what isn’t. Zoho PDF Editor gives you both capabilities in one place with its highlight and erase tools.
      • WorkDrive Desktop Sync Is Being Deprecated: Move to WorkDrive TrueSync for a Smarter Experience

        Hi everyone, We are excited to share a better, smarter way to access and manage your files directly from your computer! We’re transitioning from our legacy Desktop Sync app to WorkDrive TrueSync, designed to give you faster performance,greater flexibility,
      • Zoho Desk API returning 403 SCOPE_MISMATCH for Ticket Search API

        Hello Zoho Support Team, We are experiencing an authorization issue with the Zoho Desk Ticket Search API. Our integration was working correctly yesterday, but we are now receiving the following error when calling the Search Tickets endpoint: API: GET
      • Set connection link name from variable in invokeurl

        Hi, guys. How to set in parameter "connection" a variable, instead of a string. connectionLinkName = manager.get('connectionLinkName').toString(); response = invokeurl [ url :"https://www.googleapis.com/calendar/v3/freeBusy" type :POST parameters:requestParams.toString()
      • Introducing the Zoho Campaigns MCP server

        Hello everyone, We are pleased to announce that Zoho Campaigns is now available in Zoho MCP. You can now connect your Zoho Campaigns organization to AI tools such as Claude, ChatGPT, GitHub Copilot in VS Code, and Cursor, and manage your email marketing
      • SubForm Custom Sort - Deluge Workflows

        I have been experimenting with the Custom Order function of Subforms, it works beautifully within the subform itself and retains the sorting order. However, I need to be able to iterate through the records in Deluge using the sort order (The usage case
      • How to embed Google Analytics GA4 tracking on a standalone Public Page (outside Customer Portal)?

        Hi, Is there an official or recommended way to embed Google Analytics (GA4) tracking directly onto a standalone public Zoho Creator Page (outside of a Customer Portal)? I’m considering using an invisible Custom JS Widget as a workaround, but I’d love
      • Bank feeds automation is broken - requires manual intervention and authentication

        Yodlee supports Australian Open Banking CDR protocols natively, but Zoho Books' implementation is still triggering legacy screen-scraping MFA blocks on CBA and other business banking accounts. When will Zoho update its Australian bank feed pipeline to
      • Cannot Access Subform Display Order in Deluge

        As highlighted in this community post, we still have to deal with the significant limitation of not being able to access the user-sorted order of subform rows through Deluge. This creates a major disconnect between the UI capabilities and backend automation,
      • Process FOR loop for subform items in the order of the manual sorting

        Hi Guys, I have searched everywhere and tried everything, but I still not able to resolve one particular challenge. I have a subform in my Invoice with rows for each item. I made it so that we can change the order of the items manually. I need to be able
      • Augmenting subform capabilities

        Greetings, everyone! Finally, the day has come for us to announce some of the most anticipated, requested, and exciting updates to subforms in Zoho Creator. As you're aware, subforms are an integral part of Creator forms, as they help in establishing
      • Build appointment scheduling into your vibe-coded apps with Zoho Bookings

        Exploring vibe coding? Wondering how an app built with AI can handle appointment scheduling? Join our upcoming live webinar to discover how Zoho Bookings APIs can help connect applications to scheduling capabilities. Here's what we'll explore: • Show
      • Is there a way to make Reason For Loss field mandatory at Closed Lost stage?

        Hi guys, Reason For Loss system picklist appears on Verify Details page but it is not mandatory so as a result, AEs tend to omit it (leave at default value -None-). Is there a way to make it mandatory at Closed Lost? I tried layout rule but this field
      • Cannot reorder fields in Page Layout in Expenses and Purchase Requests

        It is very inconvenient that the custom fields in Page Layout cannot be re-ordered. The only way is to remove the fields and re-create them; however, it is impractical. This would affect the reports and dashboards we are having. Not able to re-order the
      • Request for Zoho Desk Version and Module Details

        Kindly help us confirm the version of Zoho Desk currently being used in our portal, along with the module/edition name. We require this information urgently for our internal documentation.
      • How to customize the displayed name of contacts in Trident?

        Hello, For work purposes, I sort different customers into different folders, and I also change their display names in Contacts so I can easily recognize them later. However, Trident doesn’t seem to support this. Even after I edit a contact’s name in Contacts,
      • User and mailbox reports in Zoho Mail: Review account status, storage, and login activity of users

        Administrators often need answers to questions such as which users have never logged in, whose storage is almost full, or which mailboxes are accessed through POP or IMAP. The User and Mailbox reports in the Zoho Mail Admin Console provide these details
      • ZOHO CRM APP - SALESINBOX

        Is it possible to access SALESINBOX in the CRM MOBILE APP
      • Unbundle feature for composite items

        We receive composite items from our vendors and sell them either individually or create other composite items out of them. So, there is a lot of bundling and unbundling involved with our composite items. Previously, this feature was supported in form
      • Tip #96 – See more of the remote screen with Virtual Monitor – 'Insider Insights'

        Hello Zoho Assist Community! Say you're supporting a device that has no monitor attached, like a server in a closet or a kiosk PC. You connect, and the screen is tiny, blurry, or distorted. Text overlaps and windows end up in odd places. Troubleshooting
      • Understanding transactional channels in Zoho CPaaS

        Every interaction with a business creates an opportunity to communicate.Whether it's welcoming a new user, confirming a payment, sharing an order update, or verifying a login, timely communication keeps users informed and connected. But how do businesses
      • Autoscan Settings

        I saw that autoscan is now included in my plan which is great however when I import pdf invoices from my main supplier which contain inventory lines and some also include shipping charges the autoscan doesn't match any of the items and also misses the
      • How to resubscribe to email after using unsubscribe link in Zoho

        I was testing the unsubscribe link feature from our contacts module in ZohoCRM and I sent my personal email a version of an email template with the default embedded unsubscribe link to see if it would utilize the "Email Opt Out" field to track un-subscription.
      • WhatsApp Calling Integration via Zoho Desk

        Dear Zoho Desk Team, I would like to request a feature that allows users to call WhatsApp numbers directly via Zoho Desk. This integration would enable sending and receiving calls to and from WhatsApp numbers over the internet, without the need for traditional
      • [ZohoDesk] Improve Status View with a new editeble kanban view

        A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
      • No access to contact categories in Zoho Mail Apps

        I have set up a number of contact categories for my organization. When I compose an email using a web browser these categories are visible. When I compose an email using your Android or iOS Apps no contact categories are visible. Is this expected? If
      • Zoho Plug In

        Is there anyone out there who is able to use it? I have seen lots of problems posted, unable to get any satisfactory suppport at the moment!  I would be really appreciate hearing from users that have it installed and working, my team are loosing belief it will ever work. Be great to hear from those that have a more positive experience
      • Outlook to Zoho sync

        I am the admin for our company and I have (1) single user that is having difficulties with her emails syncing. I have found where the problem is, but I don't know 100% if what is happening is how the plug-in works or if it's a setup issue. My boss created
      • Cant' find the CRM plug in for outlook

        I want to be able to tag emails that I have received into accounts. But I can't find the plug in for out look in the other apps section.  Where can I download it from?
      • Next Page