
Howdy Tech Wizards!
Welcome back to a fresh week of Kaizen!
This time, we are diving into a two-part series where you will learn how to build a Timer and Worklog Widget for Zoho CRM. This widget helps track active work time and log multitasking sessions using Zoho CRM
APIs,
Client Script,
Functions, and
Workflows.
Why It Matters?
Zoho CRM effectively captures stage/status transitions, like tracking when a case moves from Open to In Progress or On Hold. However, in dynamic work environments, employees juggle multiple work items and engage in impromptu tasks or conversations.
Let’s take the On Hold status as an example.
While it can be used to indicate pauses in progress, it does not always align with real-world workflows. Consider these scenarios:
Not all interruptions justify a status change
Moving the case to On Hold for every minor detour (to clarify something with a colleague or respond to another emergency work item) would be impractical and could lead to under reporting actual work hours. Over time, this untracked effort adds up, creating a gap in visibility.
Frequent status changes may dilute their meaning
In many teams, On Hold signifies a legitimate blocker like waiting on customer input or an external dependency. Using it frequently to reflect quick shifts in attention could compromise that clarity.
A timer widget solves this by:
- Capturing hands-on work items.
- Logging context switches (unrelated tasks) with descriptive entries.
- Feeding structured entries into a custom module for reporting and subform sync.
Business Scenario: IT Service Desk & Ticket Resolution
A tech support team uses the Cases module to resolve customer issues. Some tickets are straightforward; others require follow-ups, escalations, or cross-team coordination. While CRM timestamps (like stage transitions or picklist tracking) track when changes happen, they do not reflect how long someone actively worked on a case.
This Timer Widget can be the ultimate solution to track down the active time spent on each case through out the day.
What are we Building?
By the end of this two-part guide, you will know how to:
- Build a timer widget to track time per task or any CRM record.
- Log work sessions into a custom module every time the timer is started/stopped.
- Automatically populate a subform in the corresponding record module using workflows and Deluge functions.
- Leverage the Reports module to analyze work patterns, SLA adherence, and productivity trends.
In Part I, we will focus on:
-> Building and configuring the Timer Widget.
-> Capturing each timed session as a record in a custom module.
Prerequisites
1. Create a Custom Module
Create a custom module named Timer Entries to log work details and generate reports from the Reports module. A new record will be added to this module each time a timer is started.
Set up the following custom fields in the Timer Entries module:
| |
Start Time | DateTime |
End Time | DateTime |
Total Duration (in mins.) | Formula DateBetween(${Timer Entries.Start Time},${Timer Entries.End Time},'Minutes') |
Related to Case | Lookup to Cases module |
Work Description | |
2. Add a custom picklist option
Add a custom picklist option called In Progress to the Status picklist field in the Cases module for precisely identifying the status of the cases.
3. Setup Custom Views for Contextual Filtering
To streamline the widget experience and ensure users only see relevant records to associate while tracking time, set up two smart custom views—one in the Cases module and another in the Timer Entries module.
Active Cases View (Cases Module)
Create a custom view in the Cases module to list only the active tickets the logged-in user is working on. Use the following criteria tips:
- Use the Status field to filter records with values like In Progress, On Hold, or Escalated.
- Use the Case Owner field to show records that are assigned only to the currently logged-in user.
This view powers the drop-down inside the widget where users select the case they want to start the timer for.
Active Timers View (Timer Entries Module)
Set up a second custom view in the Timer Entries module to track entries where the timer has been started but not yet stopped. These represent active timers. Use the following logic for criteria:
- The End Time field is empty (i.e., timer still running).
- Timer Entry owner field matches the logged-in user.
This view is used internally by the widget to detect if a timer is already running and update the same entry once the timer is stopped.
Follow the
Managing List View help page and use the specifications shown in the following image.
Building the Timer Widget
Step -1: Review Basics
Refer to our earlier
Kaizen on CLI Installation, Creating a Widget Project, and Internal hosting of the same.
Step 2 - Develop the Widget
After initializing your widget project using CLI, implement the timer logic:
Fetching Active Cases
On page load, the
populateRecordsDropdown function initiates a
Get Records API call to the Cases module, using the Active Cases custom view ID. This fetches all active case records assigned to the logged-in user.
These records are then listed in a dropdown, allowing users to quickly select the relevant case they are about to work on.
async function populateRecordsDropdown() { const recordsDropdown = document.getElementById("moduleRecords"); recordsDropdown.innerHTML = "";
try { const recordsResponse = await ZOHO.CRM.API.getAllRecords({ Entity: casesModule, cvid: casesCVID, per_page: 10 });
if (recordsResponse.data && recordsResponse.data.length > 0) { recordsResponse.data.forEach(record => { const option = document.createElement("option"); option.value = record.id; option.textContent = record.Subject || "Unnamed Record"; recordsDropdown.appendChild(option); }); } else { const placeholderOption = document.createElement("option"); placeholderOption.value = ""; placeholderOption.textContent = "No records found"; placeholderOption.disabled = true; placeholderOption.selected = true; recordsDropdown.appendChild(placeholderOption); } } catch (error) { console.error("Error fetching records:", error); } } |
Starting the Timer and Creating an Entry
Once the user starts the timer, The
createRecord function triggers a
Create Record API call to log the session in the Timer Entries custom module. The record captures the start time and the related case and description (if provided).
Even if no details are entered or case is selected, a timer entry is still created with the start time. This ensures that spontaneous work sessions are tracked and not lost.
async function createRecord(startTime) { try { const workDescription = document.getElementById("workDescription").value; const selectedRecordId = document.getElementById("moduleRecords").value; const selectedRecordText = document.getElementById("moduleRecords").options[ document.getElementById("moduleRecords").selectedIndex ].text;
const data = { Start_Time: startTime, Owner: currentUserId, Work_Description: workDescription, Related_to_Case: selectedRecordId, Name: selectedRecordText };
const response = await ZOHO.CRM.API.insertRecord({ Entity: timerModule, APIData: data });
console.log("Start time recorded successfully"); } catch (error) { console.error("Error creating record:", error); } }
|
Stopping the Timer and Updating the Entry
When the timer is stopped, the widget uses the Active Timer Entry custom view to locate the most recent Timer Entry record created by the logged-in user that does not have an end time.
The
updateRecord is then triggered to update that active entry using the
Update Record API call. It updates the End time of the session and the related case, descriptions, if it was not already provided when the timer was started.
async function updateRecord(endTime) { try { const workDescription = document.getElementById("workDescription").value; const selectedRecordId = document.getElementById("moduleRecords").value;
const response = await ZOHO.CRM.API.getAllRecords({ Entity: timerModule, cvid: timerEntriesCVID, per_page: 1 });
const latestRecord = response.data[0]; if (latestRecord) { const recordId = latestRecord.id; const data = { id: recordId, End_Time: endTime, Work_Description: workDescription, Related_to_Case: selectedRecordId };
await ZOHO.CRM.API.updateRecord({ Entity: timerModule, APIData: data, RecordID: recordId }); console.log("End time updated successfully"); } } catch (error) { console.error("Error updating record:", error); } } |
Step 3 - Validate and Pack the Widget
- Follow the steps given in the Widget help page to validate and package the widget.
- Go to Zoho CRM > Setup > Developer Hub > Widgets and click Create New Widget.
- Fill in the required details as shown in this image and ensure to select Button as the widget type.
Step 4 - Associate it with Flyout
- Go to Setup > Developer Space > Client Script. Click New Script.
- Enter a name and description for the script. Choose Command type in Category.
- Create a Flyout and render a widget within it using its details like the API name of the widget, title, size, and animation type. You can get the Widget API name from the widget's detail page.
let allowedUserEmails = []; allowedUserEmails.push('user1_email_address'); allowedUserEmails.push('user2_email_address'); allowedUserEmails.push('user3_email_address'); let currentUserEmail = $Crm.user.email; if (allowedUserEmails.indexOf(currentUserEmail) == -1) { ZDK.Client.showMessage('Command access resticted', { type: 'error' }); return false; } ZDK.Client.createFlyout('myFlyout', {header: 'Timer', animation_type: 4, height: '600px', width: '500px', top: '10px', left: '10px', bottom: '10px', right: '10px' }); ZDK.Client.getFlyout('myFlyout').open({ api_name: 'Timer', type: 'widget' }); return true; |
Refer to
Creating a Client Script help page for more details.
Try It Out!
A complete working code sample of this widget is attached to this post.
Now, let us see how this Timer widget works:
1. Start the Timer
Open the widget and select an active case from the dropdown. As soon as you start the timer, a new record will be automatically created in the Timer Entries module to capture the session.
2. Stop the Timer
When the task is complete, provide a description of the work you have done and stop the timer. The same Timer Entry record (created when the timer was started) will be updated automatically with the end time and your work description.
This forms the foundation for accurate time tracking at the record level.
In Part 2, we will show how to:
-> Use a workflow and Deluge function to transfer these entries into the Work Log subform inside the relevant Cases record.
-> Use CRM Reports to slice and dice work time for better SLA and productivity insights.
In the meantime, would you like us to address any of your pain-points or have a topic to discuss? Let us know in the comments or reach out to us via
support@zohocrm.com.
Until next time, Happy Coding!
-----------------------------------------------------------------------------------------------------------------
Related Reading
-----------------------------------------------------------------------------------------------------------------
Recent Topics
Assign Multilpe Owners to a Single Deal and Split Revenue Between the Two
Hello, In our business, it is common for 2 sales reps to co-manage a deal. As such, I would like to add 2 co-owners to a deal within CRM, and then split the revenue generated by a deal between both owners in our analytics. We are currently tracking this
Mix and Match Email Plan
Dear Zoho Sales Team, I hope you’re doing well. I am currently subscribed to Zoho Mail Premium with one account. However, I would like to modify my plan by adding two Mail Lite (10GB) accounts alongside my existing subscription. Could you please confirm
Comprehensive guide to add users
We've received quite a few questions regarding adding users to the Zoho Sprints workspace. So we decided to address it through a comprehensive post covering the locations (modules or tabs) from which you can add your users. Adding users to your workspace
How to monitor hybrid projects?
Hybrid project management sounds great, but, with projects being run on different project management methods, how can we monitor the overall progress and derive insights from them? If you've got this question as well, Zoho Projects Plus’ dashboards have
Learning how to customize templates via code and best practices
Hi! Our developers team want to learn how to edit our template files safely. The last time we messed with these files our site went down for a day and we had to reconfigure it from scratch. What are the best practices to do this? How can we get a template
ULAA threat
My Sentinal One app just killed ULAA as a threat. I reinstalled, killed it again. I opened ZohoOne CRM in Chrome it worked however it was a least 1 if not 2 backsteps from the version I'm using. Is anyone else having this exerience?
Seventh Insight - Organize your data using Modules
The Wheels of Ticketing - Desk Stories Organize your data using Modules What are Modules? Modules in Zoho Desk are powerful organizational tools that facilitate efficient help desk operations. There are eight standard modules, each designed to manage
Argument Mapping went missing?
How can I access the IDs from the mass action button when argument mapping is unavailable or missing?
Properly split form fields across report rows?
Hi all, I’m trying to split file uploads from a form into separate report rows with a shared Title. Example: Form input: Title + File A + File B Desired result: Row 1: Title + File A Row 2: Title + File B Current Logic: In On Created or Edited and On
Email Alerts with Affected Flow Details When Deprecating Modules in Zoho Creator
Dear Zoho Creator Team, We would like to request an enhancement to the module deprecation process in Zoho Creator. 🧩 Current Limitation: Currently, when a module is deprecated by the Creator team: No email notifications are sent. There is no automated
Problem importing TSV file: File contains empty string as column header(s).
I tried importing a TSV file into Books, and got this message: "File contains empty string as column header(s). Please check the content and try again." I've looked at the file I'm trying to import, and the columns all have labels in the first row. Help?
How to Integrate Zoho Books with Xero (No Native Connection Available)
Hi everyone, I’m currently facing an issue with integrating Zoho Books invoices with Xero, as I’ve noticed Zoho does not provide a native integration with Xero at this time. I would like to ask: What are the common or recommended solutions for syncing
UPLOAD A CREATED PDF AUTOMATICALLY
Using the html header pdf+print button, I have managed to find a way to have a user create a pdf using entered form data. Using the schedule button, I can have a "file uploaded" pdf mailed to someone as an attachment. The missing piece is to be able to add the pdf, created in that html page to a file upload field automatically? Right now one has to save it to computer and then upload it in a FILE UPLOAD FIELD. Any help would appreciated !
Short Custom Order
Hi Everyone, I have question, i create some report use custom short order like below. But this is just show in development mode.... when i publish to production, it is not showing. And this is just showing in full admin mode. Can setting to show roles
is there a way to pass whatsapp message to Zoho CRM lead record?
so I am trying to implement WhatsApp Native Integration to Zoho CRM. What I really need is to pass Whatsapp Number and whatsapp first message to Zoho CRM lead record. yes I can see the Whatsapp Message inside lead detail record like this but as you can
How to use CDN with Zoho wesbites.
I want to use CDN with my zoho- hosted website. I currently have a dot in website. I would seriously like to utilize CDN such as MAX CDN and cloudflare. Its that am not able to change dns with dot in website. Which is a great catch. Today site speed matters a lot both for business or personal sites. I have lot of visitors from different parts of the world and they suggest to make the website more faster. I would be great if I'm able to use dns or may be cdn.
Tip of the Week #58– Stay informed by following threads!
Want to be notified about the activities happening over a specific thread without getting directly involved there? In shared inboxes, not every message requires your immediate response, but that doesn’t mean it’s irrelevant. Without a clear way to keep
Zoho CRM 表示が変わった?
いつからかわからないのですが、本日(6/3)、表示が変わったことに気がつきました。 皆さんの環境でも変わっているのでしょうか? 当方は Zoho CRM Plus で Zoho CRM Everyone 環境です。 ■タブと項目 タブのレイアウト表示名が「標準」から「スタンダード」になっている。 表示だけなので Deluge とか影響はないとは思います。 ■レコード一覧の項目選択の表示 選択すると青色線で囲いが表示されるようになった。 選択しやすくなって使いやすいです。
How do we add Google Analytics code to Zoho Bookings scheduling pages or the thank you page?
We need to track user activity on individual Bookings' pages and/or the thank you pages? How do we do this?
please include option for editing attachment name
Users need the ability to rename an attachment without having to delete the original and then uploading a duplicate just to rename the doc. We need the ability to edit the name of an attachment directly in zoho. dgdlux
Lead Created Time Field
I don't remember doing it but I must have removed the "Created Time" field from my lead module at some point. Usually it doesn't let you permanently delete fields like this but it is not in my unused fields so it must have been permanently deleted somehow.
Notebook Password Recovery?
I'm a very happy new user of Notebook, but ... my password has fallen from my memory and I am finding no avenue to reset it. How can I reset it to recover access to my notes? Thanks so much, HOC
Unable to create a download link for an uploaded Workdrive File
Hello, I have some custom logic that is working fine to load image files into a Workdrive folder. I'm not having much success however in being able to then set the file as downloadable and retrieving the download link from my custom logic. My code for
Data preservation when a Recruiter Admin leaves the organisation and account is deleted
I can’t find in the documentation on this topic, so asking here. When the Recruiter Admin employee who has done all the hiring work, e.g. publish job postings, updating email notification templates, changing candidate statuses, writing notes, communicating
Zoho Sprints mobile app(Android and iOS) v2.0
Hello everyone! We’re thrilled to announce that Zoho Sprints Mobile app2.0 is now live. With the newest version of the Zoho Sprints mobile app, we hope to provide a fresh, faster, and intuitive experience for managing your sprints on the go! Whether you're
Open-source Zoho API package for Python
Dear Community, Some time ago I have started working on Zoho API to handle data management in more automated manner than before. Then I have found no relevant materials, except of Zoho API documentation, about how to start. Of course I do not mean it
Zoho Writer and Zoho Forms - Merge on update of a form
Once Zoho Form is submitted it requires a check by the adviser / sales person and adding additional infomation to it before it gets send to the customer for the signature. Unfortuantely there is no option to Merge on update, only on submission of the
Journal Entries Do Not Show Multiple Entries to the Same Account
Another basic accounting function that Books ... Accountants sometimes write journal entries, debiting and/or crediting the same account in the same entry. This is due to the need to record specific activity in an account when we pull reports especially
Cookies
Hey Guys, being a EU based company, we're forced to show the cookie banner, providing easy to read information about the cookies we use and giving the choice to select which cookies the accept. I know in Zoho Marketing Hub, SalesIQ and Sites there are
Zoho Sign Custom Domain
Any plans for Custom Domain?
Introducing AI-powered agreement management in Zoho Sign
Hello! From automating repetitive tasks to enabling smarter decision-making, AI has moved from a futuristic concept to a practical tool for modern businesses. One of the most impactful applications of AI is in agreement and contract management. By leveraging
My bank is not in Books
Hello, I tried to configure bank feeds for my bank, but it doesn't appear in the list of supported banks. Does that mean that i cannot configure feeds at all ? Is there any way to add my bank in the list ? Also, as far as I saw, the list has no Belgian bank : Belfius, BNP Paribas Fortis, KBC,... Thanks for you answer Xavier Liégeois Though Happy Zoho user
Updating a contact record's multiple select field
Hi folks, I have a multiple select field (called Mailing Lists) in Zoho CRM which I wish to set to the text "Weekly Email" I have created a step in Zoho Flow using a Create or Update Contact. In the Mailing Lists field, I put the text "Weekly Email" (including the quotes) but the flow returns an error requesting a jsondatatype. I have tried {'Weekly Email'} but I still get the same error. Also tried Weekly Email (without the quotes) How do I format an update of a multiple select field with Zoho
CRM module name capitalisation bug ?
HI, I''m writing a deluge script from Desk to create a task in CRM. All is good when I deal with a lead, but not when a contact is involved. It took me days to figure it out. It might be a bug. Here is a snippet of my script // Ticket Description taskMap.put("What_Id",{"id":ticketContactId});
Can I convert Multiline fields from Plain text to Rich Text?
I have added several custom multiline fields (Plain text) in the Zoho CRM module "Accounts" before the Rich Text (RTF) feature was released in 2024. Now I am looking for a way to convert them to Rich Text format. Is there a way to do this? The problem
Webinar Recording: Maximizing Productivity with Bigin's Mobile Apps
Dear Biginners, Hope you're doing well! As part of our ongoing Masterclass series, we’ve just completed an exciting webinar that explores the capabilities of our mobile apps. Whether it’s managing deals, communicating with customers, or meeting deadlines,
Need Help with Zoho CRM Integration
Hello everyone! 👋 I'm currently in the process of integrating Zoho CRM with an Android gaming website focused on Fire Kirin Game. While everything is progressing smoothly, I'd love to get some expert input to make the integration as efficient and seamless
Validating an order by a superior
Hi, I have a very specific use case for Backstage. Let me know if this is possible or how I could get around this (or if there are no workaround). One of my client uses Backstage to manage internal (on site) events. Participants from different departments
Lets Talk Recruit: Key Takeaways from Our India Community Meetups
Welcome back to Let’s Talk Recruit, the series where we bring you real stories, product insights, and community highlights from the world of recruitment. Our last post covered how you can build approval processes with zero follow-ups using Recruit. In
Emails Migration to Zoho
Hi, I am in the middle of a migration from Salesforce to Zoho one. I am stuck on migratiing emails from Salesforce into Zoho. Does anyone have any suggestions?
Next Page