Power of Automation :: Invoice your timelogs automatically once the tasks are completed

Power of Automation :: Invoice your timelogs automatically once the tasks are completed

Hello Everyone,


A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and calculations. 


Requirement:


Customer would like to generate an invoice automatically once all the tasks ( associated to a Milestone) are closed.


We had accomplished this requirement using Custom functions. Create a connection for Zoho OAuth service with the scopes “Zohoprojects.projects.READ, ZohoBooks.projects.READ” to replace ‘books’ with the connection name in the below script. Click this link below to learn how to create the connection. It is possible to automate this process by associating the custom function to the Task Workflow Rules with the criteria as Task status is 'Closed'.


Script to be used::


projectsAPIEndPoint = "https://projectsapi.zoho.com/restapi";

booksAPIEndPoint = "https://www.zohoapis.com/books/v3";

getTaskMap = Map();

getTaskMap.put("milestone_id",milestoneId);

getTaskMap.put("status","notcompleted");

getTasks = invokeurl

[

url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/"

type :GET

parameters:getTaskMap

connection:"books"

];

if(!getTasks.containKey("tasks"))

{

projectDetails = invokeurl

[

url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/"

type :GET

connection:"books"

];

if(projectDetails.get("projects").get(0).containKey("other_service"))

{

financeProjectId = projectDetails.get("projects").get(0).get("other_service").get("finance_project_id");

booksDetails = invokeurl

[

url :booksAPIEndPoint + "/projects/" + financeProjectId

type :GET

connection:"books"

];

customerId = booksDetails.get("project").get("customer_id");

// create an invoice code goes here

organizationID = "798709062";

itemList = List();

taskMap = Map();

taskMap.put("milestone_id",milestoneId);

taskMap.put("status","completed");

getCompletedTasks = invokeurl

[

url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/"

type :GET

parameters:taskMap

connection:"books"

];

for each  tasks in getCompletedTasks.get("tasks")

{

// info tasks;

imap = Map();

imap.put("quantity",1);

imap.put("rate",tasks.get("rate"));

imap.put("name",tasks.get("name"));

imap.put("project_id",financeProjectId);

itemList.add(imap);

}

params = Map();

params.put("customer_id",customerId);

params.put("line_items",itemList);

info params;

response = invokeurl

[

url :"https://www.zohoapis.com/books/v3/invoices?organization_id=798709062"

type :POST

parameters:params.toString()

connection:"books"

];

info response;

response = zoho.books.createRecord("invoice",organizationID,params,"books");

info response;

}

}

return "success";

Creating custom functions in Zoho Projects is straightforward and well-documented. Zoho provides a range of built-in functions that you can use as a starting point, and you can also easily define your own functions using Zoho's scripting language, Deluge. Give it a try and see how it can save your time and boost your productivity!

 

Watch this space for more such custom function codes. 



      • Sticky Posts

      • Introducing Version-3 APIs - Explore New APIs & Enhancements

        Happy to announce the release of Version 3 (V3) APIs with an easy to use interface, new APIs, and more examples to help you understand and access the APIs better. V3 APIs can be accessed through our new link, where you can explore our complete documentation,
      • Schedule Exports for Regular Project Updates

        Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
      • Set Custom Business Calendars and Holidays for Global Teams

        Managing a project across diverse teams means accounting for more than just tasks and deadlines; it means acknowledging how and when each team actually works. Users might follow different working days or observe region-specific holidays that cannot be
      • Restore Trashed Records Anytime Within 30 Days

        Access the recycle bin from the Data Administration tab under the settings page in Zoho Projects, which gives better control over the trashed data. When records like projects, phases, task lists, tasks, issues, or project templates are trashed, they are
      • Organize and Clone Task Custom Views

        We have rolled out two new enhancements to task custom views: Custom View Groups and Custom View Clone. Custom View Groups Similar to predefined view groups, we have introduced groups for custom views to help organize and categorize them. My Custom Views:

        • Recent Topics

        • Voip Phone system that integrates with Zoho

          Just checking to see if anyone could tell me what phone system they are using with Zoho that is on the list of systems that integrate with Zoho.  I use Vonage and have been with them for quite a few years but their service has really gone down hill and
        • Removing Related Modules Lookup Fields Assignment / Relationship

          Issue: When creating a related list, I accidently selected module itself creating a circle reference. See attached. Situation: I wish to relating a custom module called "Phone Calls" to Leads and Contacts. Outcome: 1) I either want to remove the this
        • [Product Update] TimeSheets module is now renamed as Time Logs in Zoho Projects.

          Dear Zoho Analytics customers, As part of the ongoing enhancements in Zoho Projects, the Timesheets module has been renamed to Time Logs. However, the module name will continue to be displayed as Timesheets in Zoho Analytics until the relevant APIs are
        • Kaizen #210 - Answering your Questions | Event Management System using ZDK CLI

          Hello Everyone, Welcome back to yet another post in the Kaizen Series! As you already may know, for the Kaizen #200 milestone, we asked for your feedback and many of you suggested topics for us to discuss. We have been writing on these topics over the
        • Can you prevent closing Ulaa window when the last tab is closed (inadvertently)?

          Most browsers have started to bring this feature in to prevent closing their windows when the last tab is closed (inadvertently). I hope Ulaa should get this in too.
        • Seriously - Create multiple contacts for leads, (With Company as lead) Zoho CRM

          In Zoho CRM, considering a comapny as a lead, you need us to allow addition of more than one contact. Currently the Lead Section is missing "Add contact" feature which is available in "Accounts". When you know that a particular lead can have multiple
        • can I link a contacts to multiple accounts

          can I link a contacts to multiple accounts
        • Rotate an Image in Workdrive Image Editor

          I don't know if I'm just missing something, but my team needs a way to rotate images in Workdrive and save them at that new orientation. For example one of our ground crew members will take photos of job sites vertically (9:16) on his phone and upload
        • Free webinar! Digitize recruitment and onboarding with Zoho Sign and Zoho Recruit

          Hello, Tired of being buried in onboarding paperwork? With the integration between Zoho Sign and Zoho Recruit, a powerful applicant tracking system, you can digitize and streamline the entire recruitment and onboarding process, all from one platform.
        • Resume Harvester: New Enhancements for Faster Sourcing

          We’re excited to share a set of enhancements to Resume Harvester that make sourcing faster and more flexible. These updates help you cut down on repetitive steps, manage auto searches more efficiently, and review candidate profiles with ease. Why we built
        • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

          so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
        • Open Activities view.

          I really like the new views for the open and closed activities inside the deals. But when you are in the tab view instead of the column view you can only complete and edit the open activity there isn't the 3 dot option to be able to delete the activ
        • Potentially Outdated and Vulnerable Chromium Engine Installed by Ulaa Browser Installer

          I just installed Ulaa Browser a few minutes ago. Whats My Browser page shows I am using an outdated Chromium engine meaning I might be vulnerable for security exploits that might have got fixed in the new version.
        • Potentially hardcoded list of Browsers to import from (after Ulaa Setup)

          I have just installed Ulaa Browser and found that the list of browser to import data is potentially hardcoded ones rather than looking at the system. I do not have FF, IE and Edge is not my default itself. I would appreciated if Ulaa detected my browsers
        • Fat Download of Ulaa Browser

          I just observed that Ulaa Browser is offering an one-capsule big download. These days it is a custom to offer a small bootstrap downloader and based on user customization options an appropriate download completes. And this is particularly common with
        • Remember all the ways we've posted?

          The world celebrates World Postal Day in 2025 with the theme “#PostForPeople: Local Service. Global Reach". The story of the “post” is a story of human connection itself, evolving from simple handwritten notes carried over long distances to instant digital
        • From Layout to Code: Finding Custom Field IDs in Zoho Projects.

          Hello everyone! Ever found yourself wondering how to get the API names and IDs of custom fields in Zoho Projects while working on custom functions? Here’s a simple and effective way to do it! This method makes it super easy to locate the right field details
        • How to notify all members on any updates to zoho crm?

          Hi, I am using the free version of zoho CRM and currently seeing this will work for our company. We are a small company and wanted to be more informed about all the changes in zoho.   1. How do I set notifications that go to the team for any and all changes made in Zoho. At this point, we'd rather be over-informed than under-informed. 2. Create a custom field (or rename an unused field) to be able to capture any "Product Feature Requests" from customers or prospects we're talking to. I have anyone
        • Zoho Mail Desktop App Not Loading + Can’t Manage Multiple Accounts

          Hi everyone, I’ve been having ongoing issues with the Zoho Mail desktop app for the past few weeks. The app starts to load but gives up midway and never actually opens — there’s no error message, it just stops loading. The main reason I use the desktop
        • How can I transfer data from Production to Development environment?

          Hi, I am using Creator V6 and would like to bring all the data in production to the Development and Testing environments? Is there an easy way of doing that or I have to export and import each table?
        • Billing frequency is not displayed correctly.

          Hello There is an issue while displaying the billing frequency on a subscription quote. I am able to activate the subscription details and get this lovely overview: If I am adding a Plan which I charge quarterly, first of all it should be possible to
        • Calling Function via REST API with API Key gives 401 using Zoho Developer

          Hi, I created a couple of functions using the one month trial of Enterprise edition, which I was able to call using the API Key method from Postman and from an external site. Now that my trial has expired, I have created the same functions in the Developer
        • Session Expired

          I constantly get "Session Expired" and need to relogin or close and open the application again. This gets really frustrating during the day. Is this something that can be solved? This really makes me want to leave the app as it is no go to need to reopen
        • Employee type and source translation

          In Zoho People, when I fill in the employee’s information, there is the option to determine the type of employment (employee type) and the hiring source. Both options ALWAYS appear in English. It is extremely inconvenient to deal with poorly translated
        • Sync Issue Between Zoho Notebook Web App on Firefox (PC) and Android App

          Hi Zoho Notebook Community, I'm facing a sync problem with Zoho Notebook. When I use the web version on Mozilla Firefox browser on my PC, I create and save new notes, and I've synced them successfully. However, these new notes aren't showing up in my
        • Request for Clarity on Timeline for True GPT/Zia Auto-Response Capabilities

          I appreciate Zoho’s steady innovation, but I’m concerned that Desk and Zia remain well behind modern AI capabilities. For years, GPT-based tools have been able to generate and send contextual responses, yet Zoho Desk only supports summarization or suggested
        • Notebook audio recordings disappearing

          I have recently been experiencing issues where some of my attached audio recordings are disappearing. I am referring specifically to ones made within a Note card in Notebook on mobile, made by pressing the "+" button and choosing "Record audio" (or similar),
        • Has anyone built a ticket export that allows Help Center users to export the tickets shown in the My Area list they are looking at?

          Hi, We are moving to Zoho Desk soon. Our current support system displays an option in our help center allowing customers to export their Open, Closed, or all tickets based on which list they are looking at. We need to offer the same in Zoho Desk help
        • Two factor authentication for helpdesk users

          The company i work for wants use the helpdesk site in Zoho desk, as a place for their distribution partners to ask question and look for information about our product. The things there is suppose to go up there is somewhat confidential between my company
        • Zoho Desk: Q2 2025 | What's New

          Hello everyone, We are excited to announce Zoho Desk's 2025 Autumn updates. This release brings new features and enhancements that improve work management and enable businesses to provide a better overall support experience. Spanning from Zia Agents to
        • Change text in help desk

          Hi, Please let me know how can i change the this text, see screenshot.
        • Items Below Reorder Point Report?

          Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
        • Blog Widget: Show recent blog posts on my homepage

          Hey there I am using the Zoho Sites Blog feature. On my homepage, on the bottom I'd like to have a featured content section where I show some of my blog posts (selected, most recent, filtered by category and so on...). It would be nice to have a blog
        • Committed Stock and To Be Received Stock via API?

          Is it possible to retrieve Committed Stock and/or To Be Received Stock for an Item via the API? I want to use this information for calculating the amount of inventory needed to be purchased.
        • Zoho Books | Product updates | October 2025

          Hello users, We’ve rolled out new features and enhancements in Zoho Books. From iOS 26 updates to viewing reports as charts, explore the updates designed to enhance your bookkeeping experience. Zoho Books Updates for Apple Devices At WWDC 2025, Apple
        • Improved RingCentral Integration

          We’d like to request an enhancement to the current RingCentral integration with Zoho. RingCentral now automatically generates call transcripts and AI-based call summaries (AI Notes) for each call, which are extremely helpful for support and sales teams.
        • Cannot reject empty expense report

          Hello, We are currently having issues with two empty expense reports where if we try to reject them, either manually or through the REST API, we get error 114016, which says some of the expenses have already been billed and must be removed. I'd appreciate
        • Having Trouble Opening The Candidate Portal

          Recently am having trouble opening the Candidate Portal. It keeps loading but cannot display any widgets. Tried Safari, Chrome and Edge. Non of them work. Please solve the problem ASAP.
        • Checkboxes not adhering to any policy in mail merge - data from CRM

          I want checkboxes to appear depending on whether the checkbox in the CRM module is ticked or not. However, the tickboxes that appear are either ticked or not, but don't correlate to the actual selections in the CRM module. This is is despite updating
        • Items Landed Cost and Profit?

          Hello, we recently went live with Zoho Inventory, and I have a question about the Landed Cost feature. The FAQ reads: "Tracking the landed cost helps determine the overall cost incurred in procuring the product. This, in turn, helps you to decide the
        • Next Page