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.
- Lead Status is "Pre-Qualified" , foreground color is set to green and background color is set to light yellow.
- Lead Status is "Lost Lead/Junk Lead" and foreground color is set to red.
- 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)" );
|