Power of Automation : Enhancing custom date field calculations by excluding Weekends and Holidays

Power of Automation : Enhancing custom date field calculations by excluding Weekends and Holidays

Hello Everyone,

A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it.

Requirement:

One of our customers has two date fields and is currently using a formula field to calculate the number of days between them. As per design, the default formula field includes weekends and holidays in the day count. However, the customer does not want weekends and holidays to be included in the calculation. This requirement was successfully achieved using Custom Functions along with Workflow rules.
 
Custom function code:
 
portalInfo = invokeurl
[
type :GET
connection:"XXXXX"
];
holidays = portalInfo.get("portals").get(0).get("settings").get("holidays");
holidayList = List();
for each  holiday in holidays
{
holidayList.add(holiday.get("date").toDate());
}
workingDaysList = date1.workDaysList(date2,{"Saturday","Sunday"},holidayList);
info "workingDaysList : " + workingDaysList.size();
param = Map();
param.put("days_between",workingDaysList.size());
updateProject = invokeurl
[
url :"https://projectsapi.zoho.com/api/v3/portal/" + portalId + "/projects/" + projectId
type :PATCH
parameters:param.toString()
connection:"XXXXX"
];
info "updateProject : "+updateProject;
return "success";
 
Make sure to replace XXXXX with Zoho Projects connection link name along with scopes: ZohoProjects.portals.READ, ZohoProjects.projects.UPDATE. Please find the screenshot of the list of parameters to be mapped for reference.
 
We hope you found this post useful. If you have any questions, feel free to share them in the comments below.

    • Sticky Posts

    • Enhanced Collaboration and Global Web Tabs

      Hello Users, We are rolling out two key enhancements in Zoho Projects that will be part of our November release. Here’s what to expect: 1. Collaboration Section in the Left Navigation Panel What’s new? All communication and interactive tools will be grouped
    • Choosing the Right Automation in Zoho Projects

      In any project, different types of actions are needed at different points. Some projects require control on how tasks move, some require reacting to updates, and some require executing additional actions beyond the task. Automation in Zoho Projects is
    • Introducing Version-3 APIs - Explore New APIs & Enhancements

      New Update - The end of life timeline for V2 APIs has now been extended to 30th June, 2026 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.
    • CodeX Scripts for Enforcing Custom Project Logic

      Every organization has a defined way of executing projects. There are clear expectations around how tasks should move, when projects should progress, and which actions require validation. When these rules are consistently followed, projects remain structured
    • Automation Series: Auto-create Dependent Task on Status Change

      In Zoho Projects, you can automatically create and assign a dependent task when a task’s status is updated. This helps teams stay aligned, ensures reviews happen on time, and reduces manual effort. In this post, we’ll walk through an easy setup using

    Nederlandse Hulpbronnen


      • Recent Topics

      • ShipStation and Zoho Inventory

        Hello, I am looking to sync zoho inventory with shipstation ZOHO INVENTORY           SHIP STATION Sales Order  ==>  create ORDERS INVOICE  <==    Shipments What exactly does BETA mean on the Shipstation connector?  This is required for me to sign-on in the next month. Thanks in advance for your efforts
      • Connect to Shipstation's API

        Shipstation is a very big service, with lots of users, tons of order data.....and poor un-customizable reporting. This is perfect for Zoho analytics.  The Shipstation API is modern and efficient.  Today I think many people pay Zapier to get Shipstation data into Reports/CRM/Books - why not have  a direct connection?  -can pull in shipments via webhook or polling.  -also nice to pull in order data along with shipment data
      • What’s the Correct Integration Flow Between Zoho Inventory, ShipStation, and Multi-Channel Sales Platforms?

        Hi Zoho Community, I’m currently implementing Zoho One to manage all of my business processes, and I’d appreciate some guidance on the correct integration flow for the tools I’m using. Here’s my current setup: Zoho Inventory is my central system for managing
      • Remove Zoho Header from Portals

        I have a portal page with custom domain. But when I print directly from a webpage, the Zoho CRM header shows. It kind of kills the branding aspect. Is there a way to get rid of this?
      • Setting defaults for "Find and Merge Duplicate for..."

        To remove some of the extreme tedium from Zoho's poorly implemented merge function, I would like to set defaults.  Currently I am defaulted to match "ANY" when I would never do that, so I always have to click "ALL". Then it makes me click on several totally irrelevant drop boxes to turn off phone, mobile and other useless match criteria. Is there a way I can set: Match to default as "ALL" Firstname to default to "IS" Lastname to default to "IS" every other match field default to "-NONE-" This will
      • Clone a Module??

        I am giong to repurpose the Vendors module but would like to have a separate but very similar module for another group of contacts called Buyers. I have already repurposed Contacts to Sellers. Is it possible to clone (make a duplicate) module of Vendors
      • Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks

        Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks
      • CLIENT PORTAL (If clients can place orders directly on the portal)

        Zoho client portal is excellent. Everything is there except one thing. Client should be able to place orders directly on the portal. This would enhance the portal and end users will be extremely happy. This suggestion infact came from one of our client.
      • Zoho → ShipStation Integration – Sales Order–Driven Fulfilment Workflow

        Hello All, I’m reaching out to explore the best way to integrate a shipping tool into our inventory which will speed our process up. We are looking to integrate ShipStation into our existing order-to-fulfilment workflow, as we’re keen to standardise on
      • Zoho Inventory Feature Roadmap Visible To All

        Hello, please consider making your feature roadmap visible to us users so that we know what to expect in future. This may appease current users who are seeking clarification on feature implementation dates, so that they can make an informed decision whether
      • アナリティクスで商談中のパイプライン(ステージ)の件数比較

        アナリティクスで商談中のパイプライン(ステージ)の件数を前週と前々週で比較したい。前々週の件数が更新することで変動してしまう。対象方法をご教授ください。
      • How do I remove a data source from Zoho Analytics?

        I am unable to find a delte option on a datasource that i put in the system as an error. On teh web it refers to a setup icon but I do not see that on my interface?
      • Exclude Email or Domain From New Ticket Notification

        Hi, we utilize the new ticket notification feature in Zoho Desk. However, it would be great if there was a way to exclude certain email addresses or domains from receiving the automatic notification. This would be particularly helpful for automated alerts
      • Identify and clean hard bounce lists in Automation 2.0

        Hello. 1. I want to know how I can identify hard bounces in the lists I created to clean them before sending an email, given that the bounce rate has increased and it is necessary to clean the lists. 2. How can I exclude hard bounces and invalid emails
      • Trigger workflows from SLA escalations in Zoho Desk?

        Hey everyone, I’m currently working with SLA escalation rules in Zoho Desk and ran into a limitation that I’m hoping someone here has solved more elegantly. As far as I can tell, SLA escalations only support fairly limited actions (like changing the ticket
      • Delete a department or category

        How do I delete a Department? Also, how do I delete a Category? This is pretty basic stuff here and it's impossible to find.
      • Zoho Webinar - Sharing System Audio (NOT AVAILABLE)

        Hi, We are having a serious problem with Zoho Webinar. In the webinars we run, we very often share the audio from a video we are streaming directly from YouTube or other applications. Until recently we were using Zoom, but as we use other Zoho applications
      • Lost the ability to sort by ticket owner

        Hi all, in the last week or so, we have lost the ability to sort tickets by Ticket Owner. Unlike the other columns which we can hover over and click on to sort, Ticket Owner is no longer clickable. Is it just us, or are other customers seeing this too?
      • Cancellation Fees

        Hi, It really would be good if Billing could take subscription management further with cancellations & being able to apply or set a cancellation fee for a plan that is either fixed or prorated. It is not uncommon in subscriptions for cancellation fees
      • Custom Field for Subscription

        Hi, I can't find a way to add a custom field (to contain a license key generated from our software) against a subscription? Is the only place to add this information in the Invoice module (as custom field for invoice)? When a customer views his subscription
      • Zoho CRM Meetings Module Issues

        We have a use-case that is very common in today's world, but won't work in Zoho CRM. We have an SDR (Sales Development Rep) who makes many calls per day to Leads and Contacts, and schedules meetings for our primary Sales Reps. He does this by logging
      • Notes - Reaction Buttons

        Using the native notes option within CRM is fine, it works and the RTF features are great, however, would it be possible - if there isnt already something in place, where we can add a reactions button, similar to teams/whatsapp to show that its been read
      • How to get the campaingns key?

        Reading the documentations of the API, I see that is necessary have the campaign key, but I don't see how can I get it. For example to get the campaign details we need to do the request: https://campaigns.zoho.com/api/getcampaigndetails?authtoken=[API Authentication Token]&scope=CampaignsAPI&campaignkey=[campaignkey] I have the API Authentication Token but I don`t see how to generate the campaignkey
      • Unable to switch existing AWS RDS connection to DataBridge after moving RDS behind VPN

        Unable to switch existing AWS RDS connection to DataBridge after moving RDS behind VPN Hi everyone, I’m facing a problem with an existing Zoho Analytics setup and would like to know the best migration path. Originally, my Zoho Analytics connection to
      • [Bug] WebAuthn passkey registration blocked on rpIds with TLDs longer than 6 characters (.accountant, .technology, etc.) — isValidDomain regex too strict

        Hi, Filing on behalf of an enterprise customer where Zoho Vault is deployed across the company. The Chrome extension blocks WebAuthn passkey registration on legitimate sites whose Relying Party ID (rpId) has a TLD longer than 6 letters. This affects every
      • Native QuickBooks integration for Zoho CRM: Connecting sales and finance

        Greetings, I hope all of you are doing well. We're excited to announce Zoho CRM's integration with QuickBooks Web, which is designed to synchronize your CRM data with your QuickBooks accounting records and bridge the gap between sales and finance. This
      • Syncing zoho books into zoho crm

        I was wondering how I can use zoho books in crm as I have been using them separately and would like to sync the two. Is this possible and if so, how? Thanks
      • ZohoBooks_add_expense_attachment Fails

        I'm working MCP in Claude to automate bookkeeping. Claude cannot seem to attach and reciept to an expense. The 'add expense attachment' tool is added to the server and enabled in Claude. I asked Claude to give me the calls he performed and this is what
      • ZohoBooks_create_chart_of_account

        I'm setting up Claude to do my bookkeeping workflows using a Zoho MPC server I setup. He does not seem to be able to create a chart of account. The 'create chart of account' tool is added to the server and enabled in Claude. I asked Claude to give me
      • Zoho Books Product Road Map

        I am planning to look into Zoho Books to maintain my Company's Account Books. Is the roadmap of Zoho Books Development available online? What happens if you product dies, without an export feature to other popular Accounting softwares like Tally or Quickbook. Are we going to be left in lurch? Do you have a product road map? Regards, Vishal.
      • I want to delete the email but I can't.

        I want to delete emails but I can't, please help me. Thanks!
      • Error while creating new user

      • Zoho Mail is blacklisted on magicspam.com and spamauditor.org

        As of today, the same problem with the IP addresses 136.143.188.51 and 136.143.188.52 How long does it take them to clear their IP addresses? I've read on this forum that these IP addresses have been blacklisted for years. //////////////////////// This
      • Unable to send emails from the delegated mailbox

        currently it's not possible to send emails from our delegated mailbox (just in our own name, our own mail-accounts) The permissions granted include "Send as," and we are also unable to delete delegated employees or add new ones. We can only add employees
      • Change Password

        How can I reset OR Change the Passwords for the Whole Organization at Once as Administrator using Admin Console?
      • Zoho Books bill pay option not available with zoho one

        Why isn't Zoho Books bill pay add-on not available for Zoho one customers not even as a purchasable option. I think this is very inconvenient for companies wanting to use this feature all in one system
      • Support - what am I doing wrong?

        Hi Everyone - I'm a new user and looking particularly for a replacement mail service. I'm just a home user not a professional but I do look after half a dozen domains. Zoho looks lovely and I'd like to switch but just want to get answers to a few 'easy'
      • Zoho Forms - Form Availability Redirect Option

        Hi Forms Team, It would be great if there was a redirect URL option on the Form Availability settings. For example, I would like to create a support form which is only available outside business hours and if the current data and time is not Mon-Fri 9-5
      • Consider Making Printing Easier (UI)

        I'm using Zoho Analytics in much the way that it was intended when it was "Zoho Reports" - as a way to pull together information across several apps in the ecosystem. I have a dashboard that I need to run each week for every employee (change the filter
      • Email Routing to Zoho from Cloudflare

        Hello, I'm new to Cloudflare, having had my domain hosted on Fasthosts and just used it for email forwarding. I'm looking for a little help to configure my email routing/hosting. I've looked at the documentation but haven't found exactly what I need to
      • Next Page