Kaizen #89 - Color Coding using Client Script

Kaizen #89 - Color Coding using Client Script

Hello everyone! 

Welcome back to another exciting Kaizen post. Today let us see how you can apply color codes to the List and Detail Pages of Zoho CRM using Client Script.

Need for color code in Zoho CRM

When you mark things with different colors as a means of identification, it not only enhances the visual clarity but also enables the user to make efficient prioritization by quickly identifying the key information. This gives a user-friendly interface and will contribute to enhanced productivity.

Here are some common scenarios where color coding proves beneficial.

  • Enhance data integrity by highlighting discrepancies or errors using color coding.
  • Quickly identify the orders which are overdue by marking those records in a color, say red.
  • Recognize closed deals instantly, by making those records green in the List page.
  • Customize the text colour based on your preference.

Using Client Script, you can achieve color coding in List and Detail pages of Zoho CRM.

Use Case 

Consider a scenario where you are using Leads Module of Zoho CRM and you want to color code the rows in the List Page and Detail Page (Standard) based on the "Lead Status" as follows.
  • If the Lead Status is "Pre-Qualified", then those rows should have the text color as green. 
  • If The Lead Status is "Lost Lead/Junk Lead", then the status should be in red.
  • If The Lead Status is "Attempted to contact", then the status should be in orange.
In addition to this, the background color of "Pre-Qualified" rows should be light yellow on the List Page. Other values in Lead Status need not have color coding.

 For this requirement, you need to create two Client Scripts.
  • Client Script for color coding in List Page
  • Client Script for color coding in Detail Page(Standard)

1. Client Script for color coding in List Page

  • Go to Setup > Developer Space > Client Script. Click +New Script.
  • Specify the details to create a script and click Next.




 ZDK.Page.getList().style(
    {
        record: { backgroundColor: '#e9fbf4' },
        field: { Lead_Status: { backgroundColor: '#e9fbf4', foregroundColor: '#008000', fontWeight: 'bold' } }
    },
    "((Lead_Status:equals:Pre-Qualified))"   
 );
 ZDK.Page.getList().style(
    {
        field: { Lead_Status: { foregroundColor: '#ff6666', fontWeight: 'bold' } }
    },
    "((Lead_Status:equals:Lost Lead)or(Lead_Status:equals:Junk Lead))"
 );
 ZDK.Page.getList().style(
    {
        field: { Lead_Status: { foregroundColor: '#FFA500', fontWeight: 'bold' } }
    },
    "((Lead_Status:equals:Attempted to Contact))"
 );


  • Here the style ZDK is used three times, as there are three criteria based on which different color coding has to be accomplished.
  1. Lead Status is "Pre-Qualified" , foreground color is set to green and background color is set to light yellow.
  2. Lead Status is "Lost Lead/Junk Lead" and foreground color is set to red.
  3. Lead Status is "Attempted to Contact" and foreground color is set to orange.
Syntax for ZDK


 ZDK.Page.getList().style(
 {
   record: {backgroundColor: 'color code'},
   field: {field_name: {foregroundColor: 'color code', fontWeight: 'bold'}}
 },
 "(criteria)"
 );


Parameters:
  • style_config(Object) - style_config to be added to the records
  • record(Object) - To add record level styling. Supported options - backgroundColor
  • field(Object) - To add field level styling. Supported options - backgroundColor, fontWeight, foregroundColor
  • criteria(String)  - criteria based on which records should be selected. For more details click here.
Here is how the Client Script works on List Page (Standard).



2. Client Script for color coding in Detail Page
  • Go to Setup > Developer Space > Client Script. Click +New Script.
  • Specify the details to create a script and click Next.

 
var field_obj = ZDK.Page.getField('Lead_Status');
 if (field_obj.getValue() == 'Pre-Qualified') { 
    field_obj.addStyle({ foregroundColor: '#008000', borderColor: '#008000'});
 }
 else if( (field_obj.getValue() == 'Lost Lead') || (field_obj.getValue() == 'Junk Lead') ){
     field_obj.addStyle({foregroundColor: '#ff6666', borderColor: '#ff6666'});
 }
 else if(field_obj.getValue() == 'Attempted to Contact') {
     field_obj.addStyle({ foregroundColor: '#FFA500', borderColor: '#FFA500' });
 }


In the above code, the value of the lead status is captured and based on this value, different colors are being assigned.

Syntax


field_obj.addStyle({ backgroundColor: 'color code', foregroundColor: 'color code', borderColor: 'color code' });)


Here is how the Client Script works on Detail Page (Standard).



Note: 
For color coding in Detail Page (Canvas), you can use the following ZDK. 


elementid.addStyle({'background-color': 'red', color: 'white', 'border-radius': '40px'})


We hope you found this post useful. We will meet you next week with another interesting topic!

If you have any questions let us know in the comment section.

Happy Client Scripting!

    • 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

    • IP de salida 165.173.182.12 en lista negra (nosolicitado.org) – correos rechazados por Odoo

      Hola equipo de soporte de Zoho Mail: Les escribo porque mis correos están siendo rechazados por un destinatario debido a que una de sus IPs de salida aparece en una lista negra. Detalles del rebote: - Cuenta / dominio: [tu correo] / [tu dominio] - Destinatario:
    • Issues with Zoho Sheet in Mac

      I have downloaded the Zoho App from App Store but It is failing to Save As, Open & Download Operations. App Store
    • To-do lists screwed up by update

      My app just updated, and now it's unusable for my grocery and packing lists and pretty much everything I use this app for. It used to be that when you checked a box on a to-do list, the item was automatically migrated to the bottom of the list. Then when
    • Campaign send from unverified e-dress

      L.S. I have a problem with z-Campaigns. My email (sender) address seems to be unverified: Verified domain. Sender couldn’t be verified This email is from your organization’s verified domain, but the sender couldn’t be verified. It may be an automated
    • Change default "Sort by"

      Is there a way to change the default "sort by" when searching across modules?" in Zoho CRM? Currently the default sort method is "Modified time" but i would like to utilize the second option of "relevance" as the sort by default and not have to change
    • New Search Function

      Hey Team, The search function updated in our CRM about a week ago, so I assume it was an automated update across Zoho. It no longer displays leads/deals etc in Chronological order so that the most recently created or updated is the first to display which
    • Large List on Sub-Forms

      Hi, I would like to be able to add and use the Large List on a Sub-Form, currently it doesnt appear to show up for Sub-Forms. Thanks Dan
    • Feature Request: Post-commit Subform Row Event (onRowSave / afterRowCommit) in Client Scripts

      Hello Zoho CRM Product & Engineering Team, Requested Feature: Introduce an afterRowCommit (or post-commit onRowSave) subform event in Client Scripts that fires immediately after an inline subform row has been successfully committed to the database, passing
    • #CyberSecurityAwareness - Be diligent when it comes to Widget security

      We love Widgets in Zoho CRM! And in our experience they have become an essential tool for extending the feature set and providing a rich user experience beyond standard CRM UI, functionality and integrations. BUT BEWARE... If you are thinking of adding
    • 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
    • Deluge {"trigger":{"workflow"}} Do we need to add the id of rules of functions or rules in the workflow ?

      Hello , I've user {"trigger":{"workflow"}} in Deluge language. In my Deluge code, in order to trigger the workflow, I've specified the id of the workflow, of the rules and of the function called by the workflow. However, Zoho CRM told me that it was not
    • Let’s Talk Recruit: Answering your hiring review’s top five questions

      Picture this, it's the final week of the month, and your hiring review is just around the corner. You already know the questions you'll be asked. Which roles have been open the longest? Why did the Product Designer pipeline go quiet after the second interview?
    • What's New in Zoho POS - October 2026

      Hello everyone, Welcome to Zoho POS’s monthly update, where we bring you the latest feature releases, enhancements, events, and more. Let’s take a quick look at the new item price override option for embedded barcodes and how it can help streamline your
    • VENDORS ARE NOT SYNCHED WITH CONTACTS IN CRM

      Hello, While the ACCOUNTS and CONTACTS (Including the primary contact) are synced with the CONTACTS module in CRM, the vendor's CONTACTS are not synced with CRM - which basically forces the users to re-enter all vendor's contacts twice and then update
    • Hide Inactive Social Sign-In Providers from Login Screen

      Hello Zoho Team, We hope you are doing well. Currently, Zoho One allows admins to configure security policies and enable or disable Social Sign-In options for third-party providers such as Apple, Google, Microsoft, LinkedIn, Yahoo, Twitter, Facebook,
    • Feature Request: Render Markdown (.md) files in Zoho Cliq

      Hi, We regularly share Markdown (.md) files in Zoho Cliq. However, when we open these files in Cliq, the content does not render as Markdown—it displays as plain text. This forces us to copy/paste the content into an external Markdown viewer to read it
    • Default value in custom multi line field

      No option to add default value in custom multi line field??
    • Backorder process review - Automating Removal of Sales Order from "On Hold" When PO is Received

      Hello Zoho Inventory Team, Currently, sales orders in On Hold status are released only when the bill for the purchase order is created. In our workflow, it would be much more efficient if the sales order could automatically move out of On Hold as soon
    • Running Balance

      Please add automatically Running balance in ledger view. Taking lot of time, every time to add manually
    • Minor Problem: Dashboard Forgets Cash vs Accrual

      The dashboard doesn't reflect my cash/accrual choice from settings, AND doesn't remember what I've set it to.
    • Map Dependency Upgrades in Zoho CRM

      Map Dependency Fields enhancements are now available across all DCs. Hello everyone, We’ve introduced a set of enhancements to Map Dependency Fields to make setup simpler, faster, and more intuitive. Map Dependency helps control how values appear across
    • Die Zoho ZUG Community Meetups sind wieder da | November 2026

      Liebe deutschsprachige Zoho Community, Es ist wieder Zeit, die Zoho Community zusammenzubringen! Unsere nächste Meetup-Reihe steht an. An zwei Terminen im November ist wieder Zeit für neue Themen, anschauliche Live-Demos und viel Raum für persönlichen
    • APIs and Webhooks in Zoho CommunitySpaces

      APIs in Zoho CommunitySpaces let you work with your members, discussions, events, and knowledge resources, so you can automate engagement workflows and extend what your community can do. What can you do with APIs? You can manage your communities and events,
    • Introducing Bigin's latest AI features, built for the way you work!

      Hi Biginners! In continuation of our AI journey that began on mobile and grew with the MCP release, we're bringing AI features right inside your Bigin web interface, where it makes the most impact for your business. At Bigin, we believe in building features
    • Rehearsing changes before deployment - Sandboxes in Zoho Projects

      Dear users, You've invariably been in these project situations - adding an additional stage to verify deliverables, revamping the approval process, adding team members with different permission sets to a sensitive project and so on. As a project owner,
    • Partial payments for retainer invoices

      When a customer does not pay the entire retainer invoice there is no way to apply a partial payment. PLEASE add this function.
    • Trace topping failures with Function Logs

      Hello everyone, Debugging a topping issue used to mean starting from scratch, with no visibility into what its custom functions actually did or where things broke. Function Logs change that; for any topping installed in Bigin, you can now see the execution
    • 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
    • Category codes in General Ledger

      Creation of category codes in general Ledger
    • Question about Zoho CRM Professional plan users

      Hello! I have a question about the Zoho CRM Professional plan. Is the pricing charged per user or per organization? Are there any free users included in this plan, or do I need to pay for each additional user separately? Thank you!
    • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

      Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
    • ZOHO EMAIL ALIIES AS101 ERROR

      Hi zoho team, I am having this issue AS101:Internal Error occurs when creating under USER TAB - email allies. please guide me and can you help me to fix issue from your side. ASAP 
    • Remove the mandatory Name Card buttons (or at least make them optional)

      Please remove the mandatory Name Card buttons (or at least make them optional) A recent change to the Name Card in Zoho SalesIQ (currently affecting WhatsApp) introduced mandatory buttons before a visitor can provide their name. I believe this change
    • Ticket duplicating when multiple "To Address" are messaged

      Hello, I want to know if there is a way that I can stop the duplication of tickets when clients email multiple emails related to the same department at the same time. In our case, we basically use ZDesk like email. Each agent has a designated "To Address"
    • Looking to Auto-Merge Duplicate Tickets

      Hi guys, I need the option to auto-merge duplicte tickets and i dont see this option available in automation , Can this be done? And if so how, Cheers
    • Add bulk ticket merge functionality in Zoho Desk

      Hi Zoho Team, We would like to request a feature that allows agents to merge multiple tickets in bulk instead of merging them one by one. Current Limitation At the moment, tickets can only be merged individually. This becomes very time-consuming when
    • Spell Check Icon Disappeared yesterday for Agent Comments

      We always use "Public Comment" when communicating on tickets with our customers. For years we had the "Spell Check" icon when typing a comment. Yesterday, this icon disappeared for comments and is only avaialable when drafting a response via "Reply."
    • Spell Checker in Zoho desk

      Is there a way to set always check spelling before sending? Outlook does this and it is a handy tool to avoid typos
    • Adding additional records dynamically to a subset of fields

      I'm trying to create a service ticket layout which will be passed to a Creator application for Field Service Management (FSM) purposes. We need to be able to define a specific subset of service product fields such as "Service Product", "Service Product Serial Number", "Service Product Warranty End Date" and "Service Product Current Warranty Status". We may need to record more than one of these subsets, in case the customer has more than one product which has to be serviced on their site. It seems
    • When Will Existing Zoho Campaigns 2.0 Orgs Convert to 3.0?

      Hi Zoho team, I'm very excited to start using Campaigns 3.0, but I don't see any notifications related to moving my org to the new version. What is the roll-out plan for existing users? Thanks
    • Next Page