Client Script for tags

Client Script for tags



Hello everyone!

Welcome to another informative Kaizen post. In this post, let us see how to accomplish the following using Client Script.

1.  How to auto-tag a record based on field update?

2. How to Open a pre-filled email draft 

This post will provide a quicker solution using Client Script for the queries mentioned in the posts Is it possible to auto fill email draft? and How to tag quickly?

In this Kaizen post,



  1. Tags in Zoho CRM
  2. ZDK functions related to Tags
  3. Use Case 
  4. Solution
  5. Summary
  6. Related Links



1. Tags in Zoho CRM

Tags in Zoho CRM are not just a simple category; they can be more powerful since you can add multiple tags to a single record. You can also create tags in multiple locations in your CRM account, if required. Click here to know more about working with tags.
2. ZDK Functions related to Tags

Below are the ZDK Client APIs supported by Client Script related to tags. Click here to view the documentation.
  • addTag()  - Add a tag/tags to a record
  • removeTag() - Remove a tag/tags to a record
  • getTags() - Get the list of all tags of a record

Notes
Note :
 These ZDKs can be used only for Detail Page(Canvas) and Detail Page(Standard)

Apart from these, you can use the below ZDK CRM APIs to add and remove tags.
  • addTagsToRecord()         - Add Tags to Record
  • addTagsToRecords()       - Add Tags to Record
  • removeTagsToRecord()  -  Remove Tags from Record
  • removeTagsToRecords() - Remove Tags from Records

Notes
Note
The above ZDKs implicitly invoke the Add tags API and Remove tags API. Click here for more details.The execution of the above ZDKs will impact your API credits

To know more about Client Script's ZDKs to implicitly invoke CRM APIs, check this kaizen post. The event onTagChanged - This event occurs on the click of save button of Add tags.

3. Use Case 

Quote
At Zylker, the manager seeks to optimize the handling of order complaints by automating the tagging and notification process. When a customer support agent who places an order on behalf of customers also logs a complaint in the "Order Issue" field of the Orders module, then the order should automatically be tagged as "Issue Reported." This action should open an email draft, pre-filled with a specific template , along with the "To," "From," and "Subject" fields automatically populated after getting confirmation from the customer support agent, and notify the delivery team to check and resolve the issue.

4. Solution

For the above requirement, you need to create a Client Script that triggers when the customer support agent updates the Order issue field.
  • Configure a Client Script for Detail Page(Standard) Orders module, that triggers during onBeforeUpdate Event of Type Field event of Order Issue, as shown below and click Next



  • Click here to know how to configure a Client Script.
  • Enter the following script in the IDE and click Save.

  1. if (value != null) {
  2.    ZDK.Page.addTag('Issue Reported');
  3.    ZDK.Client.showConfirmation('The Tag *Issue Reported* has been added successfully.    Do you want to notify support team?', 'Yes', 'No');
  4.     ZDK.Client.openMailer({ from: 'support@zylker.com', to: [{ email: 'zylker@zyldomain.com', label: 'zylker@zyldomain.com' }], cc: [{ email: 'info@zyldomain.com', label: 'info@zyldomain.com' }], subject: 'Issue Reported', body: '', templateId: "4967860000006521006" });
  5. }
  • In the above script, whenever the customer support agent updates comments in this field, a new tag gets added by ZDK.Page.addTag(). Here is the syntax:


  • Once the tag gets added, a message gets displayed using the ZDK.client.showConfirmation(). The message mentioned in the confirmation box supports markdown. Based on confirmation, the mail draft opens using ZDK.Client.openMailer(). Here is the syntax:


  • Here, you need to specify the template ID of the email in the openMailer() ZDK along with the other details like from, to , cc. 
  • To get the template ID, go to setup-->templates-->select the template that you want and click edit.
  • You can pick the template ID from the URL.


  • Click here to know more about email templates. Here is how the Client Script works.


    Summary

    In this post, we have seen
  • How to add a tag automatically to a record when a Detail Page is updated.
  • How to fetch the tags associated with a record using Client Script.
  • How to open pre-filled email draft from Detail Page(Standard)
  • How to fetch the template id of an email

Related Links: 

Let us know your thoughts in the comment section or reach out to us at support@zohocrm.com. Stay tuned for more insights in our upcoming Kaizen posts!


Happy Client Scripting!


      • Recent Topics

      • Retrieve separate records from multiselect lookup field

        Hi, I know there are many post on this one, but I just don't get it. I have a multiselect look-up field named Delivery containing 3 different informations like this : Montreal - Tuesday - 3 to 4 pm I need to do an IF script based on the first item in
      • Candidate Registration/Invitation

        It would be great to include the 'invite' candidate functionality into some of the automation functions - ether through a custom function trigger or webhook or accessible through an email template.  Currently there is no way to add this functionality into any workflows or blueprint steps which, I find limits the ability to invite candidates to engage with us directly through our candidate portal. 
      • Multiple workflows based on stage?

        I am trying to have multiple things happen when I close a deal. First, I would like to send a thank you/coupon email to all deals that are closed. Second, I would like to create connected records in a separate pipeline for certain projects that qualify.
      • Deluge script that creates a popup with a dropdown list of choices

        Hi, In an order form, when a portal user choose a delivery day, another field is automatically filled with a delivery location, and that field is not linked with a lookup. I have now one day of the week that has 2 delivery locations. I do not want to
      • Can't connect to Blogger & Wordpress

        Hello Zoho Support Team, Thank you for providing Zoho Writer—it’s a fantastic tool that I truly enjoy using. However, I’ve encountered an issue when attempting to connect it to Blogger or WordPress for automatic posting. When I try to establish the connection,
      • In what case it's better to use Developer Console? Only for marketplace?

        As I can see from the documentation, the limitations are challenging. No Custom API No Page Variables No Custom Connections.
      • Multi-Select Flow Between Modules

        Hi, I have a Multi-Select Fields in my "Clients" module in Zoho CRM. Whenever that fiels is created or updated, I want it to reflect a similar field in my "Enrollments" Module -- so they match. I keep running into JSON errors for some reason. The main
      • Sharing an entire Zoho Learn space externally

        Dear Zoho Community, I am enquiring about the possibility of externally sharing an entire space via a weblink. Our objective is to utilise one of our spaces as a client-facing knowledge repository. We would like to offer clients access to this space through
      • Fillable template with dynamic tables?

        Is there a way to build a fillable template so that users can add rows to a table? To describe what I'm trying to accomplish the table has 3 sections; a header row, some number of rows with custom information, and a summary row with totals. I can't figure
      • Automated Shopify adjustment problem. "An inventory adjustment has been created by the system to set the initial stock from Shopify"

        Has anyone noticed issues since the Shopify Sync has been updated recently? If you sync with Shopify, check to see if there are automated adjustments for old products that keep recurring. We have this problem for 6 SKU's that Zoho is doubling the stock
      • Custom Branding for mobile app

        Just like in Salesforce: https://help.salesforce.com/s/articleView?id=xcloud.salesforce_app_customize_branding.htm&type=5
      • Issues with completing calls using ZohoCRM and RingCentral

        My company has been a multi year customer. We have always used RingCentral for making our sales calls. In a normal call, we are presented a green button next to the phone number of either a company or contact we want to call. Lately, after a few calls,
      • Select a balance sheet account when creating an invoice

        Hi, it would be very helpfull to be able to select a balance sheet account when invoicing clients. We bill 30% of the job at signing and we would like to add to deferred revenues.  I have to create a transit revenue account and then tranfer to the right
      • Add Serial Number Zoho CRM Subform

        Hi Guys, I need to add Serial Number in Zoho CRM Subform table. In addition of an row we can easily create in Zoho Creator. But in Zoho CRM how we can do that? Any suggestion would be very helpful.
      • Rounding off rate in quote

        Hi team, Please help me to rounding of rate amount in quote
      • GSTIN Public Search API

        Does zohobooks have an api using which i can search GST numbers and get their details?
      • List of API for report

        Can I have list of API for Reporting ? Like this API : https://www.zohoapis.com/books/v3/reports/customerbalances?organization_id={{Organization.Organization_ID}}&accept=pdf
      • GST composition scheme dealer - treatment for client expenses reimbursement

        Hello, I am new to GST and need your help. I am registered as a composition dealer and attract 6% gst charges. In bill of supply, there are also expenses done on behalf of client for which I seek reimbursement AT ACTUAL with NO MARKUP. As I understand,
      • zoho book API - Price list (create / update /delete) - Is there any documentation?

        Hi there, Is there any documentation on how to create a price list on zoho book via API? There's nothing on the API guide. Thanks in advance Claire
      • how to get Access Token & refersh Token

        https://accounts.zoho.com/oauth/v2/token?code=&client_id=1000.DP4CU4M4AT0BJBX7KT5YUMIO1PNQTE&client_secret=ca66e715e9c387711166997b44fc45924b960385fa&redirect_uri=myurl&grant_type=authorization_code this error: {"error":"invalid_client}
      • zoho feedback

        I hope you are doing well. I wanted to take a moment to express my appreciation for the Zoho ecosystem and how it has positively impacted my business. Since I started using Zoho Books in 2019, I have found it incredibly efficient in managing my operations.
      • Remove Special Characters "\" using Zoho Deluge

        Who needs this? I don't know! I did, and I sure did not find any helpful information out there, not with this keyword though. So, if you find this article because you searched the same thing as I do, then hey, you're in luck! And do note that I am not
      • How do you apply field validation to a date field?

        We are using Sign for remote e-signature of liability waivers. The signer must enter a date of birth, and if they are a minor their legal guardian must sign for them. However we have had numerous problems with signers returning an invalid date of birth
      • Why is this an Invalid Collection String Error?

        Here's the code snippet: Enddate = EventEnd.toDate("yyyy-MM-dd"); EventCollection = Collection(); EventCollection = zoho.crm.searchRecords("Events", "(End_DateTime:starts_with:"+Enddate+")"); for each eventday in EventCollection { //create a list of events
      • Confirmation prompt before a custom button action is triggered

        Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
      • Login for test case

        Had a few questions regarding authentication test cases and couldn't find an answer in the the docs. 1. If an app like Zoho Creator requires authentication before providing access, do I need to create a login function and add it to each test case? 2.
      • Merge Tickets Directly from Contact Page in Zoho Desk

        Dear Zoho Desk Support Team, We are writing to request a new feature that would allow users to easily merge tickets directly from the contact page in Zoho Desk. Currently, the only option to merge tickets is from the Tickets list view page, which can
      • Zoho Error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details

        Hello There, l tried to verify my domain (florindagoreti.com.br) and its shows this error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details. Screenshot Given Below -  please check what went wrong. Thanks
      • Separate Triggers and Enhanced Information for Zoho One Departments and Groups in Zoho Flow

        Dear Zoho Flow Team, I hope this message finds you well. Currently, there seems to be a mix-up between zoho one departments and groups in Zoho Flow, which causes some challenges in handling triggers effectively. For instance, when using the "User added
      • Create Quote does not show the "Product Description" entered as part of the Product setup.

        The product description created as part of the product setup page, does not show in the Create Quote module; The module allows for an additional description to be added but without access to the original stored description. By selecting the product from the "Product Name Lookup" pop-up, the "Product Description" part should be populated from the product record where the user is allowed to further modify it.
      • Add bank transfers via a webhook or API

        Hello ZOHO Books Community, is there anyway to add single transactions to bank accounts via an API or webhook? I found in docs to upload a bank statement. But i want to add a transaction from an external (unsupported bank) in the moment there is a transaction
      • Which WhatsApp API works seamlessly with Zoho CRM?

        I’m exploring WhatsApp API solutions that integrate seamlessly with Zoho CRM for customer communication, lead nurturing, and automation. I would love to hear insights from those who have successfully implemented WhatsApp within Zoho CRM. My Requirements:
      • Multi Select Between Modules

        Hi, I'm not sure if this is possible, but I want to "import" or "mirror" the multi select options from one module to another. For example... I have Module "Clients" with a Multi Select Field of "Enrolled Services" I also have a Module "Services" with
      • Zoho Desk View Open Tickets and Open Shared Tickets

        Hi, I would like to create a custom view so that an agent can view all the open tickets he has access to, including the shared tickets created by a different department. Currently my team has to swich between two views (Open Tickets and Shared Open Tickets).
      • Is a record ID in Zoho Books always numeric?

        Hi Support Team, For storing Zoho Books' contact, invoice and other record IDs in an external app, I wanted to know if the IDs are always numeric. As far as I can see in Books, they are all numeric and while fetching a record via the Zoho Books API, passing
      • Using IMAP configuration for shared email inboxes

        Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
      • Work Orders / Bundle Requests

        Zoho Inventory needs a work order / bundle request system. This record would be analogous to a purchase order in the purchasing workflow or a sales order in the sales cycle. It would be non-journaling, but it would reserve the appropriate inventory of
      • Resubmit for Approval for Zoho Books Module in CRM

        The integration between CRM and Books is great, but it is incomplete in many areas. One of them is if an estimate/invoice/sales order is rejected, the users in CRM cannot resubmit it for approval. Let's face it, sales people will mostly be in CRM and
      • Automatically add a retainer to every estimate

        Hi all, I've been trying to find a way to automatically add a retainer at a set % to every estimate we create and send. So far I haven't been successful, does anyone know of a way to do this? Thanks,
      • New in WorkDrive: WorkDrive Genie, a quick-editing app for desktop (Beta)

        The WorkDrive Genie app lets you open and edit any of your WorkDrive files on the web with your default desktop applications. For example, you can open and edit files such as documents, images, and videos with Microsoft Word, CorelDRAW, and Adobe Premiere
      • Next Page