Using Custom Functions to Solve a Complex Use Case in Zoho Projects

Using Custom Functions to Solve a Complex Use Case in Zoho Projects

Custom functions, also known as user-defined functions or UDFs, allow you to create your own functions in addition to the built-in functions provided within Zoho Projects. One of the key benefits of using custom functions in Zoho is that they allow you to automate complex tasks and calculations.

For example, if you want the status of a parent task to be updated in correspondence with that of its sub-task, this feature lets you write your own code which will perform the desired function. The code below when executed will automatically change the parent task's status to "To be tested" when its sub-task moves to the "To be tested" phase.


// TODO: Please create a connection for the Zoho Projects service with the scopes "ZohoProjects.task.ALL". Replace 'xxxxxxxxx' with the connection name. Click this link below to learn how to create the connection.
taskDetails = zoho.projects.getRecordById(portalId,projectId,"tasks",taskId,"xxxxxxxxx");
info "current task Details : " + taskDetails;
info "-------------------------------------";
parentTaskId = "";
if(taskDetails != null && taskDetails.get("tasks") != null && taskDetails.get("tasks").size() > 0)
{
taskInfo = taskDetails.get("tasks").get(0);
parentTaskId = taskInfo.get("parent_task_id");
}
info "parentTaskId: " + parentTaskId ;
if(parentTaskId != null && parentTaskId != "")
{
parentTaskDetailsOfCurrentTask = zoho.projects.getRecordById(portalId,projectId,"tasks",parentTaskId,"xxxxxxxxx");
if(parentTaskDetailsOfCurrentTask != null && parentTaskDetailsOfCurrentTask.get("tasks") != null && parentTaskDetailsOfCurrentTask.get("tasks").size() > 0)
{
parentTaskInfo = parentTaskDetailsOfCurrentTask.get("tasks").get(0);
parentTaskStatusId = parentTaskInfo.get("status").get("id");
updateTaskParameter = Map();
updateTaskParameter.put("custom_status",parentTaskStatusId);
info updateTaskParameter;
taskDetails = zoho.projects.update(portalId,projectId,"Tasks",parentTaskId,updateTaskParameter,"xxxxxxxxx");
info "updated Task response : "+ taskDetails;
}
}

return "success";


Custom functions also make it easier to collaborate with other team members on your codebase. By encapsulating complex logic in reusable functions, you can create a more modular and flexible codebase especially useful when working on large, complex projects with multiple team members.

 

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. If you're facing a complex use case in Zoho Projects, I highly recommend giving custom functions a try.

 

Watch this space for more such custom function codes.

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts



                                                            • Sticky Posts

                                                            • 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,
                                                            • Update on V2 API End-of-Life Timeline

                                                              Dear Users, Earlier this year, we shared the launch of the V3 APIs and requested users to migrate from the older V2 APIs by December 2025. We have received valuable feedback from our users and partners regarding their migration timelines. We are happy
                                                            • Automation Series: Auto-update Phase Status

                                                              Hello Folks! You can auto-update your phase's status based on status of underlying tasks using custom functions. In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your
                                                            • Automate Timesheet Approvals with Multi-level Approval Rules

                                                              Introducing Approval Rules for Timesheets in Zoho Projects. With this automation, teams can manage how timesheets are reviewed and approved by setting up rules with criteria and assigning approvers to handle submissions. Timesheet, when associated to
                                                            • Accessibility Spotlight Series - 1

                                                              Every user interacts with products differently, what feels intuitive to one may be challenging for another. Addressing this, accessibility is built into Zoho Project's design philosophy. This helps users navigate and perform actions with ease irrespective


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                              • Recent Topics

                                                                                                              • Direct Access and Better Search for Zoho Quartz Recordings

                                                                                                                Hi Zoho Team, We would like to request a few enhancements to improve how Zoho Quartz recordings are accessed and managed after being submitted to Zoho Support. Current Limitation: After submitting a Quartz recording, the related Zoho Support ticket displays
                                                                                                              • Update date & time when a cell is edited

                                                                                                                Hi All, I am desiring to have a cell update with the current date and time when another cell is edited. Any ideas?  Thank you
                                                                                                              • Ask the Experts 26: Brighten every customer interaction with Zoho Desk all year long

                                                                                                                Hello everyone, Greetings and welcome to Ask the Experts 26. As we wrap up 2025, we are excited to invite you to the 26th episode of our Ask the Expert series. 🎄The Merry Metrics Edition = Best of Zoho Desk [Best Practices + Holiday Automation + Year-End
                                                                                                              • Add "Groups" to "Share With" on Reports & All Entries

                                                                                                                Hi, On Forms we can share Publicly, with Specific Users And/Or Specific Groups or All Users. With Reports and All Entries we lack the "Groups" option, please add this as with many users this saves a lot of work. Thanks Dan
                                                                                                              • Add Pause / Resume Option to Zoho Quartz Recordings

                                                                                                                Hi Zoho Team, We would like to request an enhancement to Zoho Quartz recordings: the ability to pause and resume an ongoing recording. Current Limitation: At the moment, when recording an issue with Zoho Quartz, the recording continues even when we are
                                                                                                              • Custom Fields Not Showing Up in Invoice PDF Template Document Information

                                                                                                                I have added 2 custom fields under Sales > Invoices > Manage Custom Fields. They are set to show in all PDFs. However when I am editing my Invoice PDF template, i do not see the custom fields under Document Information.
                                                                                                              • Tracking Non-Inventory Items

                                                                                                                We have several business locations and currently use zoho inventory to track retail items (sales and purchase orders). We were hoping to use zoho inventory to track our non-inventory items as well (toilet paper, paper towels, etc). I understand that we
                                                                                                              • Can I use a Standalone CRM Function as the Callback URL For Async Export Data API?

                                                                                                                I am creating an export job using this API https://www.zoho.com/analytics/api/v2/bulk-api/export-data-async/create-export/view-id.html There is a "callbackUrl" key in the CONFIG object. I tried copying the URL for a standalone function in CRM which can
                                                                                                              • ZOHO Books

                                                                                                                Hi there, Why after I upgrade my Zoho invoice > Books then i wanted to add plugin which i cannot do. Please advise.
                                                                                                              • How is Your eCommerce Experience w/Zoho Inventory?

                                                                                                                First off, I'm SUPER grateful for the advent of Zoho Inventory and now the Zoho Commerce Suite. Overall, Inventory is a great product, especially for customers without an eCommerce presence. For eCommerce companies (especially those shipping more than ~10 packages/day), however, there are certain drawbacks that keep my clients from moving over to Zoho Inventory: Cons: 1. Invoice + Package Creation from Shopify/Other eCommerce Integrations: Zoho Inventory makes the somewhat perplexing decision to
                                                                                                              • Cliq iOS can't see shared screen

                                                                                                                Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                                                                                              • Operation Questions.

                                                                                                                Hello, I hope you are well. To explain a little, we are a company that sells services and products with a technical team responsible for installation and maintenance. Zoho FSM can be useful for the technical team, namely for the technical coordinator
                                                                                                              • Error AS101 when adding new email alias

                                                                                                                Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                              • Simplify Mass Replies with Predefined Templates and Snippets

                                                                                                                Hello everyone, We are happy to introduce a new enhancement to Mass Reply that helps agents respond to customers quickly and consistently. With the addition of Email Templates and Snippets in the reply window, agents can use predefined messages while
                                                                                                              • Add "Groups" above "Users" in the Zoho Forms Left Menu

                                                                                                                Hi, We have Groups but you have to go to a Form and Share or use the Directory App to manage them, please add "Groups" above "Users" in the Zoho Forms Left Menu so you can manage them in 1 place within Zoho Forms too. Thanks Dan
                                                                                                              • Exciting Updates to the Kiosk Studio Feature in Zoho CRM!

                                                                                                                Hello Everyone, We are here again with a series of new enhancements to Kiosk Studio, designed to elevate your experience and bring even greater efficiency to your business processes. These updates build upon our ongoing commitment to making Kiosk a powerful
                                                                                                              • Mapping custom fields from one module to another

                                                                                                                I have a custom field, "Subscription Period" that appears as a required field in every Opportunity (Potential). I want that field to appear on any Quotes derived from that Opportunity (and have created a custom field of the same name in Quotes for that
                                                                                                              • Inquiry on Help Centre Tab Customisation

                                                                                                                Hi Zoho team, I’m wondering if it’s possible to further customise the Help Center tabs, specifically the descriptions under Knowledge Base, Community, and Tickets. While the current setup allows customising tab names, being able to tailor the descriptions
                                                                                                              • Passing the CRM

                                                                                                                Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
                                                                                                              • The Social Wall: November 2025

                                                                                                                We’re nearing the end of the year, and the holiday season is officially kicking in! It’s that time when sales peak and your social media game needs to be stronger than ever. We’re back with exciting new updates across AI, analytics, and the mobile app
                                                                                                              • Item name special charaters <>

                                                                                                                Im trying to input speical characters such as < and > into item name and item description but comes up with following error: Invalid value passed for Item Name and Invalid value passed for Item Description How do i allow speical characters?
                                                                                                              • How to update Multi File upload field

                                                                                                                Assume that i have a multi file upload field,how can i update the same field again?
                                                                                                              • Passing a form object to a function

                                                                                                                Suppose I have a sort_order field in multiple tables and I want to increment it by +1 onCreate of a new record. Is there a way to pass the form object as an argument into the function to keep things DRY? The following function from Zia works, but I'd
                                                                                                              • Customer Address Not on Standard Invoice when Address is on Contact Record

                                                                                                                Hi,  I entered the customer billing and shipping address in Zoho CRM. I created an invoice in Zoho Books with the same customer contact. The contact is correctly in Zoho Books with the billing and shipping address. The invoice for the customer does not
                                                                                                              • Auto-Invite Users to Portals in Zoho CRM based on Conditions

                                                                                                                Hello Everyone, You can now automate portal invitations in Zoho CRM with the new Auto-Invite users feature in Portal management. No more manually enabling portal access one by one. With this enhancement, you can automatically send invites for users to
                                                                                                              • Apply partial payments to invoices from the Banking Module

                                                                                                                We need this! Why is this not possible?
                                                                                                              • Welcome to the Zoho Show Community Forums page!

                                                                                                                Hello everyone, The Zoho Show community is a place for you to discuss and share anything and everything related to Zoho Show Presentations, our online presentation software. It includes users from all over the globe and all walks of life. Our community helps answer your Zoho Show questions with responses from other knowledgeable community members to give you the best experience creating and designing exciting presentations. Along the way, you'll meet recognized experts from our software team and
                                                                                                              • Regarding the integration of Apollo.io with Zoho crm.

                                                                                                                I have been seeing for the last 3 months that your Apollo.io beta version is available in Zoho Flow, and this application has not gone live yet. We requested this 2 months ago, but you guys said that 'we are working on it,' and when we search on Google
                                                                                                              • How can I convert an existing contact into a lead?

                                                                                                                I imported many contacts into ZOHO CRM. In order to select a few of them as leads, I want to mark or convert a few hundred as Leads. Who can I do that?
                                                                                                              • Introducing Dedicated Modules for Plans, Addons, and Coupons in Zoho Billing

                                                                                                                We’ve enhanced the way you manage Plans, Addons, and Coupons in Zoho Billing. Previously, all three grouped together under Subscription Items. Now, each one has its own dedicated module, giving you a cleaner and more intuitive experience. This update
                                                                                                              • Price book functionality enhancement

                                                                                                                A common use of price books is to create a price book for a given customer level or contract with a specific company. Given that this is done at a company/customer level it would be great to see a way to associate a price book to a given customer and
                                                                                                              • SMS to customers from within Bigin

                                                                                                                Hi All, Is there anyone else crying out for Bigin SMS capability to send an SMS to customers directly from the Bigin interface? We have inbuilt telephony already with call recordings which works well. What's lacking is the ability to send and receive
                                                                                                              • Tracking Emails sent through Outlook

                                                                                                                All of our sales team have their Outlook 365 accounts setup with IMAP integration. We're trying to track their email activity that occurs outside the CRM. I can see the email exchanges between the sales people and the clients in the contact module. But
                                                                                                              • Contact data removes Account data when creating a quote

                                                                                                                Hi, Our customer has address fields in their quote layout which should be the address of the Account. They prefill the information, adding the account name - the address data is populated as per what is in the account - great. However when they then add
                                                                                                              • Important update about notification security in Business Messaging SDK

                                                                                                                As part of our ongoing effort to strengthen the security of notification data, we have enhanced how notifications are processed and protected in our applications. These improvements ensure that all notification related data follows the most up-to-date
                                                                                                              • 年内最後のユーザー向けイベント:5名限定! 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (12/18)

                                                                                                                ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 12月開催のZoho ワークアウトについてお知らせします。 今回はZoomにて、オンライン開催します。 参加登録はこちら(無料) https://us02web.zoom.us/meeting/register/QHn6kJAcRs-znJ1l5jk0ww ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。
                                                                                                              • Saved Sections?

                                                                                                                In sites editor, the + button reveals options to add a section, element, etc. It includes Saved Sections, but I can find no way to save a section I've already created. Otherwise, is there a way to copy a section from one page to another?
                                                                                                              • Sync Zoho Marketing Automation with Zoho Forms

                                                                                                                I can't find a section where the integration between Zoho Marketing Automation and Zoho form is explained. And how form subscription works with opt-in and consents.
                                                                                                              • What is the difference between Zoho Campaigns and marketing hub?

                                                                                                                Zoho Campaigns is a permission-based email marketing tool for sending marketing emails and mass emails. Marketing Automation is a multichannel marketing automation tool that caters to organizations looking for tools to engage their users across multiple
                                                                                                              • Webhook not firing.

                                                                                                                I created a webhook using the Web UI, it looks very nice and the testing worked without an issue, but when i save/ update a ticket, the webhook is not firing. Here are the details of the web-hook i get from using the API "modifiedTime": "2019-10-22T09:23:37.380Z",
                                                                                                              • Next Page