
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
Free tier
Does a completely free tier Zoho email still exists? If so why am I receiving email reminders that my account would expire in 2 days
Disable "skip to content" in Help Center
Our users used to be able to press the tab button to skip between fields when submitting a new ticket in the help center. Now it pulls up the "skip to content" button in the top left corner. I know this is an accessibility feature, but is there any way
Mail Data Migration
Hello Team, I have an issue with my organization mail data migration from Google to Zoho. We used Google Workspace before now but decided to change to Zoho to enjoy your service. I have successfully created an account and 1. Complete Domain verification
Prompting email addresses when sending an email
Hi, I was just wondering if it was possible to disable the prompt / suggestion of email addresses when you begin typing an email address into the TO or CC box? Some of the email addresses that are being suggested are people that no longer require the
This is a HTML email and your email client software does not support HTML email!
I have a small business, recently the email notification is coming like this to me, can anyone please help me? I am not so IT savvy -----=_NextPart_b4583c76c623900f59ad5b420c6da260 Content-Type: multipart/alternative; boundary="----=_NextPart_b4583c76c623900f59ad5b420c6da260_alt"
How to insert a ZohoUser in a subform field?
I am building an new external web app that uses the ZohoCRM REST API (v8) to push data to Zoho. How do I use the ZohoCRM REST API to insert ZohoUsers into a subform field? I've tried several approaches and none of them have worked - inserting the ID as
Unable to receive emails
Hello - I set up an email account for my domain. I can send emails but cannot receive them. I believe the issue might be with incorrect IMAP configuration (?) - but im not sure and cant find where this is on the platform. Im using Zoho hosting for the
Zoho Account delete function
Hello Zoho support team The issue is as follows: Step1: Created an account community@bisonenergy.net Step2: Deleted this account. Step3: Created the new group mail using the same mail address, but the data already exists. So I have to change the name
help, 554 5.1.8 blocked
got this blockade, i don't know why?
Not Receiving Emails from Gmail, but Other Providers Work Fine
Hello, I'm experiencing an issue where my Zoho Mail account does not receive any emails sent from Gmail addresses. However, I can successfully receive emails from other providers such as Hotmail and Yahoo. There are no problems with sending emails—I'm
Basic String Search Not Possible in CRM Deluge – Feature Request or Workaround?
Hi all, I’m trying to solve what should be a very basic automation task in Zoho CRM Deluge: Find the first 11-digit number anywhere in a string (specifically an email subject). In almost any programming language—even 1980s BASIC!—this is a trivial loop:
Reencaminhamento de e-mails.
Boa tarde, gostaria de saber se tem a possibilidade de realizar o reencaminhamento de um e-mail especifico. Ex. Eu recebo alguns e-mails de um remetente e gostaria que o meu amigo de trabalho também recebesse esse e-mail, somente deste destinatário, é
Knowledge base articles is now available in the Zoho Desk mobile app!
Hello all, As a customer service agent, every day you might have to deal with many questions and issues reported by the users. With Knowledge Base, you can reduce the issue resolution life cycle for your organization. We are delighted to announce that we have brought in support for 'Knowledge Base articles' in the Zoho Desk iOS mobile app. This feature is already available for Android users. KB articles are available to iOS users in the latest version of the app (v2.4.9). You can update the
Set Default Payment Method & Default account
Hi, I would like to know how to set the default payment method and default bank account when recording payments in zoho books. At present we have to change these fields everytime we record a payment, which leads to potential error and as we have a very
More than one "Other" response in a Multiple Choice (Many Answers) question type?
Is there a way to have more than one "Other (Please Specify)" with a short response as an option to a Multiple Choice (Many Answers) question? I understand there may be other ways, but I am looking for this way specifically as it would be best for the
Zoho Surveys
Dear Zoho Support Team, I hope this message finds you well. I am writing to inquire about the availability and documentation for the Zoho Survey API. Background: I am currently working on a project that requires programmatic access to survey data and
Help Needed: Jira to Zoho Projects Migration — Tickets Imported as Unassigned & Comments Under Admin Name
Hi Zoho Team and Community, We recently completed a migration from Jira to Zoho Projects using the official import method outlined in this Zoho Help Article. Issue Summary: We had already added all users to Zoho Projects before the migration, using the
Zoho Finance Estimate to Deal Attachment
Hi, I'm trying to fetch estimate pdf from zoho books and upload it as deal attachment without success. any tips how to achieve this?
Journeys - how do i branch on contact call result
Hi all. I want to branch based on the Call result field in contacts. Any idea how I can do this? Also what is the best way to have this condition checked at each step? Thanks!
The 3.1 biggest problems with Kiosk right now
I can see a lot of promise in Kiosk, but it currently has limited functionality that makes it a bit of an ugly duckling. It's great at some things, but woeful at others, meaning people must rely on multiple tools within CRM for their business processes.
Perform custom actions from the Ticket interface using Buttons
Hello everyone, We have introduced an option to add Buttons to the tickets, which will facilitate direct access to other applications, websites, allows execution of custom workflows, and more. Accessibility and visibility of buttons The buttons can be
Inserting a video from library in microsite
Hello, We have uploaded videos in our space library. We created a new event and want to use the videos in our main page our microsite. It's possible to selected image from the library, but no videos. Only URL are accepted, but videos in library have no
UUIDs
Has anyone coded a Universal Unique Identifier (UUID) generator in Deluge?
Create Tasks in arbitrary Zoho Project triggered from CRM [Zoho Projects]
Community, hello What I'm trying to do is to create a Zoho Project when a Deal is created in CRM and then to be able to add tasks to this Project also from Zoho CRM with the trigger (Blueprint/ Workflow). I succeeded in creating Project using Zoho Flow,
Invalid Client - Client ID passed does not exist
Hi, Daniel here. i try to generate an authorization code by following this page Authorization Request - Web Apps - OAuth | Zoho Accounts https://accounts.zoho.com/oauth/v2/auth?scope=ZohoCRM.users.ALL&client_id=1000.myclientid&response_type=code&access_type=offline&redirect_uri=https://localhost:7195/account/integrations/zoho/tokencallback
Generate Token v2 api using c# sdk
Hello I am trying to generate a access token using c# sdk but fails every time.is there any sample code so that i can implement that code to insertleads in crm. my use case is i want to insert and update lead in zoho crm. when user signup in my website i insert the detail of that user in crm using API v1. but V2 api is more confusing that API v1 . so please can anyone provide me a sample code of c# sdk to generate token and insert lead in crm. Or is there any way to achieve this without using c#
Upsert your missing data without affecting the historic logs
Dear Customers, We hope you're well! Migrating your data from a legacy system to Zoho CRM is a critical operation as it deals with treasured data. In an unfortunate event, if you have missed to move your historical datasets, you have had to repeat the
Dashboard won't save, nor allow me to do a "save as"
For some reason, one of my dashboards won't let me make any modifications to it and save? I get the "do you want to save before closing?' and I say yes and the dialogue box just stays there. I try to do a "save as" right after I open that dashboard and I get the dialogue box that seems to let me name the new dashboard, but it won't let me save. The dialogue box just stays there unless I hit cancel or no. Can you please help? Jamie
Copying Files Between Modules
Hi, I'm creating a Deluge script and I've hit a roadblock. I'm trying to copy files from one module (let’s call it Module A) into another one (Module B). Here’s what I’m doing: record = zoho.crm.getRecordById("Module_A", record_id); files_toCopy = record.get("Files_From_A");
Problem with scheduled report sending in Zoho Analytics
Problem with scheduled report sending in Zoho Analytics. Reports are not sent due to size. How can I increase it?
【Zohocreator】ログについて
ワークフローのDelugeスクリプトのinfo関数が出力するログはどこから見れますか?
US military addresses
When we have a client with a US military address having them fill in a form is a problem Zoho forms doesnt acommodate them correctly. It doesn't make sense for me to have to create a secondary data model for military addresses. I have placed some links
Introduction of Robotics Process Automation in Zoho products
It will be great if Zoho can start advancing from automation to robotics process automation. For a start, it can be started with smart document understanding. Provide OCR engines Google cloud, Microsoft Azure Computer vision OCR, Microsoft OCR, Omnipage
Automation#34 : Automate Email threading for Ticket notification
Hello Everyone, It's been a while since we've presented an automation. However, our community has been buzzing with ideas, use cases, and discussions with our community experts and Ask the Experts session. So, here we are again, presenting an automation
Zoho Sigma and Catalyst IPs for Whitelist
Hi there, We are developing a series of integrations between Zoho CRM and Zoho Desk with an on-premises system for a customer and they have firewall rules to access their server, so they are requesting the list of IPs addresses for our backend calls,
【開催報告】大阪 ユーザー交流会 2025/6/5 Zoho サービスを活用して業務をアップデート
皆さま、こんにちは。コミュニティチームの中野です。 6/5(木)に、大阪 ユーザー交流会 を開催しました。本投稿では、その様子をお届けします。 当日の登壇資料などもこちらに共有しますので、参加できなかった皆さまもご参照ください。 (Zoho社員セッションの登壇資料については、8月に開催する福岡 ユーザー交流会の開催報告で共有予定です。) 今年初の開催となる大阪 ユーザー交流会では、akippa株式会社 内藤さんによるZoho CRM / Forms の事例セッションのほか、 「見込み客・顧客データの管理/活用方法」をテーマに、参加者同士でZohoサービス
Moving forward, can we change our reports to send record ID's by default?
With the new policy of not including record ID's in reports, is there a way to default to including them in my reports as they used to be?
WhatsApp integration isn't very useful at all (no workflow support)
We have set up WhatsApp through Business Messaging. It works, but there appears to be no workflow support for messages that are sent/received! Without being able to trigger a workflow when an inbound message is received, my colleagues would have to manually
Zoho CRM 差し込み文書テンプレート if文
Zoho CRM の差し込み文書のテンプレートを作成しています。 フッターにページが 2ページになる場合は、「次葉へ」と言う文字を表示したいのですが、ページ数による判断はできないのでしょうか? 現在はサブフォームの行数で判断しているのですが、複数サブフォームを差し込んでいるので、合計何行で2ページ目になるのか把握が難しく、ページ数で判断できればうれしいなと思い、質問させていただきます。 ※行総数はワークフローでレコード保存時にカスタム関数でサブフォームの行数をカウントして数値を保存しています。
Record payment: Payment Mode vs. Deposit To and how to "connect" them!?
How do we set up that when we choose: "Payment Mode"= Cash, then "Deposit to" is automatically set to Petty Cash, and if we choose "Payment Mode"= Check, then "Deposit to" is automatically set to Undeposited Checks, and if we choose "Payment Mode"=
Next Page