Automation Series: Mandatory Time Logging Before Task Closure

Automation Series: Mandatory Time Logging Before Task Closure

In a project, when users work on multiple tasks simultaneously, they track time in different ways, either by starting a timer or by adding a time log. Sometimes users may forget to add time, which can lead to discrepancies in the timesheet.

When timesheets have incorrect time logs, the billable amount might not reflect the true budget and can lead to inaccurate billing. CodeX Script addresses this by displaying a custom message, forcing the user to add a time log before they update the status of a task.

Let's consider a law firm where associate attorneys move between Client Consultations and Case Reviews. During a consultation session, an associate might start a timer and update the task status to Under Review without logging the time. With this Codex Script, a message is triggered while attempting a status change to Under Review, keeping the task in the existing status until the time is logged.

To configure this in your Zoho Projects portal,

      1. Navigate to the upper-right corner of the page and click  → Developer Space → Connections.
      2. Click Create Connection, choose Zoho Projects as the service, and add the following scope:
  1. ZohoProjects.timesheets.READ
      3. Navigate to Developer Space → CodeX Scripts.
      4. Click Create CodeX Script in the upper-right corner.
      5. Enter the CodeX Script Name.
      6. Select the required Module, Layout and Event as shown below.

Codex Script

      7. Add the following Codex script in the script editor.
  1. // scopes: ZohoProjects.timesheets.READ
  2. function main() {
  3. if (current.affectedFields.status) {
  4. if (current.affectedFields.status.newValue.name == "Under Review") {
  5. const url = `https://projects.zoho.eu/api/v3/portal/${current.org.zohoOrgId}/projects/${current.record.projectId}/timelogs`
  6. const request = new HttpRequest();
  7. request.url(url);
  8. request.method('get');
  9. request.params({ "view_type": "projectspan", "module": { "id": current.record.id, "type": "task" }, "page": "1", "per_page": "200" });
  10. request.connection('connectionprojects');
  11. const response = request.execute();
  12. if (response.asJson().statusMessage.responseText.time_logs.length == 0) {
  13. throw new ScriptError("Add timelog and complete the task");
  14. }
  15. }
  16. }
  17. }
Info
Line 4: Replace "Under Review" with the task status name configured in your portal.
Line 5: Replace the domain like AU, EU, CN, IN etc.in the URL to match your data centre
Line 10: Replace "connectionprojects" with your Zoho Projects connection name.
Line 12: Replace the Script Error message with the prompt text you want displayed to the user.
      8. Click Save to execute the script.



Once this is setup, time logging does not have to be yet another task to be remembered, keeping time logs complete and billing records accurate.

Do give this a try and let us know how it works for you in the comments below, or write to us at support@zohoprojects.com for any questions.

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Collaborate Visually with Whiteboard in Zoho Projects

            Whiteboard in Zoho Projects allows you to collaborate visually by creating diagrams, annotating designs, and sketching project workflows using shapes, text, and images within project modules. Team members can work simultaneously, improving productivity
          • Create Flexible Layouts with Layout Rules

            In a project, when a work moves from planning to execution, the information teams need can change at every stage. A project can need one set of details, a phase can need another, and a custom process may require an entirely different set of information.
          • Introducing the Zoho Projects Learning Space

            Every product has its learning curve, and sometimes having a guided path makes the learning experience smoother. With that goal, we introduce a dedicated learning space for Zoho Projects, a platform where you can explore lessons, learn at your own pace,
          • Improve User Onboarding in Zoho Projects with Zoho DAP

            Rolling out new processes or onboarding new users in the tool comes with a familiar challenge: the employees need guidance at the moment they are doing the work. Traditional training sessions and knowledge sharing often require users to leave the application.
          • Create Custom Module Using AI in Zoho Projects

            Every team has its own way of managing work. While standard modules support common project management needs, many business processes require their own structure, fields, and terminology. With AI-powered Custom Modules in Zoho Projects, users can create

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方

                                  • Recent Topics

                                  • Facturation électronique 2026 - obligation dès le 1er septembre 2026

                                    Bonjour, Je me permets de réagir à divers posts publiés ici et là concernant le projet de E-Invoicing, dans le cadre de la facturation électronique prévue très prochainement. Dans le cadre du passage à la facturation électronique pour les entreprises,
                                  • Marketing Tip #18: Make your online store mobile-friendly to improve traffic

                                    Most online shoppers browse on their phones first. If your store is hard to read, slow to load, or tricky to navigate on mobile, they’ll bounce fast. A mobile-friendly store doesn’t just look nice; it improves engagement, reduces drop-offs, and helps
                                  • Cannot add note to record on mobile

                                    In the latest version of the mobile app - if a record already has notes associated with it - you can add a note via the mobile app - if a record does not have previous notes there is no way to add a new one - it allows me only to send email
                                  • Dashboards for Customers

                                    Is it possible to build dashboards for each customers in the community for their tickets?
                                  • Custom color coding for your entities

                                    Our brains are fine tuned to recognize colors before any text or shapes, making color coding a powerful tool to organize data and find items quickly. Color coding of our day-to-day work help with quickly processing the information, reducing cognitive
                                  • The Social Wall: August 2026

                                    Hello everyone. Welcome to the August 2026 edition of The Social Wall. This month, we're bringing you updates that make it easier to reach your audience, manage more channels, and streamline your publishing workflow. Here’s what’s new. WhatsApp bulk messaging
                                  • Check out in Meetings

                                    Why there is no check out in Meetings of Zoho CRM, very difficult to track
                                  • How do I get to "Admin Panel"

                                    I just started a Cliq account. I am the sole administrator. As I read the documentation, I keep seeing reference to an "Admin Panel". I see no way to access this from my Cliq account. How do I access this panel?
                                  • 【初開催! オンライン】Zoho Campaigns メール配信の基礎・活用勉強会を開催します! 10/15 参加無料

                                    ユーザーの皆さま、こんにちは。 Zoho コミュニティグループの中野です。 Zoho ユーザーコミュニティ初となる、メールマーケティングをテーマにしたオンライン勉強会を開催します! ▶︎イベント詳細・参加登録はこちら 今回取り上げるサービスは「Zoho Campaigns」です。 「Zoho CRMとZoho Campaignsのどちらからメールを配信すればよいか分からない」 「一斉配信はできるようになったけれど、現在のリスト管理や設定が正しいか不安」 「メールを送るだけで終わり、配信後の改善につなげられていない」
                                  • Marketing Tip #46: Run flash sales the right way

                                    A flash sale can do a lot for your store. It can clear slow-moving inventory, spike revenue on a slow day, or reward your most loyal customers. But if done carelessly, flash sales can backfire. Customers start expecting discounts, stop buying at full
                                  • Introducing Smart Fields in Zoho Forms

                                    Hello form builders! We are excited to introduce Smart Fields in Zoho Forms - a faster way to add calculations to your forms without writing formulas. Instead of creating multiple fields and configuring complex calculations yourself, you can now drag
                                  • Checkbox not displaying correctly in subform

                                    Greetings: I have shared my app (wv) with support.  I am having problems with a checkbox field not displaying correctly in a subform.  The main form is called volunteers and the subform is called volunteers_subform.  The field in question is called roles. When you access the subform by itself the checkbox lookup displays as checkboxes.  But when you view it in the main volunteers form, it displays as a multi-select dropdown instead.   I have attached jpegs showing the difference.   Any thoughts?
                                  • Unbundle feature for composite items

                                    We receive composite items from our vendors and sell them either individually or create other composite items out of them. So, there is a lot of bundling and unbundling involved with our composite items. Previously, this feature was supported in form
                                  • Valid characters for use in email addresses using Zoho's apps/APIs

                                    We have found an issue with the + sign character in zoho subs - we are allowed to create a customer with an email address that has a plus sign but the API doesn't allow the + so the billing portal is not created. We are going to prevent users from using
                                  • Expand Zoho Analytics Spatial Capabitlities

                                    Dear Analytics team Thanks for the great product - I'm a big fan on Analytics and the monthly release highlights is one of my favourite emails to receive. I'd like to request expansion and improvement of Zoho Analytics spatial data capabilities, namely:
                                  • Automate customer follow-ups with Sequences in Bigin

                                    Greetings, We hope you're all doing well! We're happy to announce a new feature that we've added to Bigin. Following up with every lead at the right time can be challenging, especially when your team is managing multiple conversations across emails, calls,
                                  • Displaying only unread tickets in ticket view

                                    Hello, I was wondering if someone might be able to help me with this one. We use filters to display our ticket list, typically using a saved filter which displays the tickets which are overdue or due today. What I'd really like is another filter that
                                  • Can we have an automated TDS Receivable Recon with Form 26AS of Income Tax Portal ?

                                    Can we have an automated TDS Receivable Recon with Form 26AS of Income Tax Portal ?
                                  • Customers would like to add tips when paying in Client Portal

                                    I am happy with the clean interface of the Client Portal. However, I am running into a challenge: my customers would like to be able to add tips/gratuities when making payments. Currently, this is very clunky because they have to 1) manually over-pay,
                                  • Tag Limi?

                                    is there any way to create more than 20 tags? 
                                  • prefill_data for Creator + Merge & Sign

                                    Hello, Is there an option to use prefill_data for signer fields from creator? I see the option for CRM but it will not work with creator? I have tried passing the value in the signer data, and that also does not work. Alternatively, is there a way to
                                  • Can I Build a Gaming Website Using Zoho? Need a Quick Roadmap

                                    Hi Dear Members, I want to create a gaming website using Zoho. Is it possible? My goal is to build a sleek, unique, easy-to-navigate, and fast-loading website for a gaming project. I want the site to look professional, user-friendly, and optimized for
                                  • Remove Due Date from Statements

                                    Is it possible to remove the Due Date on the Invoice transation line on statements? I have figured work arounds to get the Invoice detail on the Statement but cannot work out haw to simplify the stament by removing the "- due on xx/xx/2026" - it really
                                  • What Should an Agent-Native Project Workspace Look Like

                                    AI is moving beyond assistants that simply answer questions. With tools like MCP, agents can now interact directly with project data and perform actions. That makes me wonder: what should an agent-native project workspace actually look like? For me, it
                                  • unable to join meeting due to speaker issue

                                    unable to join meeting due to speaker issue
                                  • How to add formatting in zoho.cliq.postToUser(...) message?

                                    In a CRM Deluge function, I'm trying to use the message formatting guidelines given here: https://www.zoho.com/deluge/help/cliq/posting-to-zoho-cliq.html#message-formats My message is: message: #Title text. The result in Cliq is: #Title text. (no large
                                  • Marketing Tip #50: Sell digital products and use them to grow your store

                                    Physical products need packaging, shipping, and stock management. Digital products need none of that. Once created, they can be sold an unlimited number of times, delivered instantly, and never go out of stock. What counts as a digital product? A digital
                                  • Can I import customer data from Zoho Invoice to Zoho CRM?

                                    I have been using zoho invoice for a couple of years and have built up my client list here. I am now giving Zoho CRM a shot and am hoping I can get a lot of my already established data (financial trading records) over to zoho crm?  Can anyone tell me if this is possible and how can I do it? 
                                  • Automating CRM backup storage?

                                    Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                  • Turn off Mobile Optimize

                                    Hello is it possible to stop the automatic mobile optimization of my site as it looks much better on a mobile in full site format rather than mobile format. Thanks
                                  • How to select from pricebook when creating a salesorder or quote

                                    I am creating a sales order and when selecting the Products I do not see any where to select from pricebooks. How do i associate this to my orders?
                                  • API - Available Stock Definitions

                                    Okay, Zoho team... your copywriters fell down on the job for this one :) I think these warrant a bit more explanation as to what they include and what they don't.
                                  • Cross-application Deluge calls fail when application link name starts with a number

                                    I encountered an issue when calling a custom function in another Zoho Creator application within the same account. The target application’s URL/application link name began with a number, similar to: 27_example_application The following cross-application
                                  • Transformez vos webinaires en opérations automatisées

                                    Organiser un webinaire, c’est bien plus que passer en direct. Il faut gérer les inscriptions, suivre les participants, envoyer les enregistrements, mettre à jour le CRM… et s’assurer que chaque étape se déroule au bon moment. L’automatisation des workflows
                                  • Cash Basis VAT RETURN REPORT Required in Saudi Arabia

                                    Zoho Books in Saudi Arabia not showing TAX RETURNS report on CASH Basis.. It only showing accrual basis. Oforur requirement is both reports (Cash Basis and Accrual Basis ) , same like indian Edition of Zoho Books showing. CASH BASIS RETURN is our Basic
                                  • Marketing Tip #1: Optimize item titles for SEO

                                    Your item title is the first thing both Google and shoppers notice. Instead of a generic “Leather Bag,” go for something detailed like “Handcrafted Leather Laptop Bag – Durable & Stylish.” This helps your items rank better in search results and instantly
                                  • How can I filter inactive/disable agent tickets?

                                    Hello, We have an user-agent that left the company and we inactive/disabled his agent. So, now I can no longer filter or search tickets that he is the current owner, or even create a rule to reassign tickets to another person when the ticket is reopen.
                                  • How do i move multiple tickets to a different department?

                                    Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
                                  • Add Reauthentication Option for Zoho Bug Tracker Integration in Zoho Desk

                                    Hello Zoho Desk Team, We hope you're doing well. We would like to request an enhancement to the Zoho Bug Tracker integration within Zoho Desk. Current Limitation: At the moment, there is no option to reauthenticate the Zoho Bug Tracker integration in
                                  • Create Package From A Picklist

                                    Dear Zoho, Can it be made possible to create a package from a picklist? The reason our company makes a picklist is for that to become a package Our sales orders have 600-1000 items I hope that makes it clear that it's hard to delete 990 items when we
                                  • Next Page