Zoho Deluge: Nested Catch Statements
- Category: Zoho Deluge
- Hits: 26686
What?
A really quick article on demonstrating a nested try...catch()... statement working in Zoho CRM.
Why?
To prove a point to ChatGPT who said this was not possible... and to deal with a scenario which exists for a client of mine.
The use-case for my Cx is that they need documents converted from HTML to PDF — as in we send it a bit of code in HTML and we want a PDF file returned. I have severaly instances of an API which accepts HTML and returns a PDF file. Nothing complex but issues with one of the servers being down, or inaccessible due to certificate expirys, means that the Cx business halts. In order to add a bit of clustering, we have added a bit of code for it to try one server first, if there is any kind of an error with that server, it tries a second server... We now want to add a third server to try if the first 2 fail for whatever reason.
How?
Admittedly, perhaps this maybe wasn't possible but as of February 2024; I have been able to test and implement this.
Zoho Deluge: Convert Hex to RGB
- Category: Zoho Deluge
- Hits: 17215
A quick article to document a Zoho Deluge function converting a hexadecimal color reference to a Red Green Blue value (RGB).
Why?
It's likely that Zoho will avail their color picker at some point as an input but at the time of print, this hasn't happened yet. Here's a function in deluge that takes a 3 or 6 character hexadecimal color and returns the RGB values for you.
How?
Very quickly, we take each character from the given string and convert it to its RGB value. Replace letters A to F with their numeric equivalents. Made up of 2 characters to convert to an RGB subset, the 1st value is to be multiplied by 16 and then added to the value of the 2nd; this equals the RGB value.
Zoho Deluge: Determine your Statement Execution Limit
- Category: Zoho Deluge
- Hits: 25425
A very quick article on how to check what the statement execution limit is on the Zoho application you are working in.
Why?
Our use-case is that an application we built in Zoho Creator was hitting statement execution limits and rather than proposing an upgrade or add-on to the subscription plan; we wanted some proof using code.
How?
We're going to use a quick snippet of some code. So create a function in the Zoho App you are checking, or somewhere you can write some Zoho Deluge code.
Note that requesting an increase of the limit or an upgrade to the subscription will likely to have to be asked directly to Zoho rather than using the online subscription plan management section.
Zoho Deluge and Wordpress/WooCommerce API: Get All Products
- Category: Zoho Deluge
- Hits: 42268
A quick article on retrieving all the products from a WooCommerce instance on a client's Wordpress website.
Why?
A client of ours wants the information entered against products in their WooCommerce to display on their estimates in Zoho Books; such as product image, product name, product description.
Granted that in some cases, the design should go in the other direction, as in enter the products in Zoho Inventory and this feeds the website. More than often, however, this request comes in when the customer has already been setting their Zoho environment up and the Wordpress site has the more information.
How?
So first, this article shows you how to setup an API connection, and then we'll include the code to count the total number of products, and then finallly show the code to loop through all the pages to retrieve every product from the WooCommerce system.
Zoho Deluge: Proper Case for Names
- Category: Zoho Deluge
- Hits: 25958
This is an open article without any completion in mind; to set the proper case of a name, as in capitalize the first letter, lower case the rest but then with exceptions.
Why?
Some of the Zoho Apps are incredibly case-sensitive and consider some records containing people's names as duplicates, when actually they are the same entity but may have uppercased a letter in their name while the other entry does not...
This article is a start and adaptation of my previous article Convert to Proper Case in T-SQL which I had previously used for the migration of a HR system. This is intended to work using Zoho Deluge.
How?
There are a number of combinations that I won't have thought of but the below code sufficed for my current task, common English and some European names:
Zoho Deluge: Get the Week Number if Week starts on a Monday
- Category: Zoho Deluge
- Hits: 29184
A quick article on determining the week number of the year if your week starts on a Monday and not a Sunday.
Why?
I think it's the US system which generally says that a week starts on a Sunday but in the United Kingdom, the week generally starts on a Monday. So let's say there's a schedule that has to be run weekly and include all the orders of a specific week...
Just to confuse everyone in the world, the day index for a Sunday is 7 (ie. myDate.toString("u") returns 7) and the week commences on a Sunday (ie. myDate.toStartOfWeek("EEEE") returns Sunday). In other words, the day counting starts at 7, followed by 1 for Monday, 2 for Tuesday, and so on...
How?
The logic behind this would be to take the date of the order, check if the order date is a Sunday, subtract a day, and return the week number:
Zoho Deluge: Determine if Daylight Savings are in effect
- Category: Zoho Deluge
- Hits: 22447
If you're lucky enough to build an application for a client based in a country that changes its clocks twice a year, then I'm opening this article without a 100% certain solution as I need to wait about 4 months until I can confirm this works.
Why?
I've covered this before in a fair few articles on this website but for clients in the US, where there could be 4 different timezones between customer, agent, HQ, server; we would create a separate table to manage this data. I can't do this for every client, so here's a quick snippet to just check if Daylight Savings are in effect for the United Kingdom.
How?
Based on the fact that the United Kingdom is on the Prime Meridian and when no daylight savings are in effect, the hour difference to UTC (Coordinated Universal Time) should be zero, then for checking if daylight savings is in effect in the UK, we should be able to take Greenwich Mean Time and compare to UTC.
Zoho Deluge: Get All Orders from eBay
- Category: Zoho Deluge
- Hits: 34600
Following on from my article: ZohoCRM: Get All eBay Active Listings, this is how to get all the orders from a client's eBay.
Why?
Our use-case is a data migration from eBay to a fresh instance of Zoho Inventory. In this task, we are simply getting a CSV with all the order IDs for a particular year output as a spreadsheet.
How?
Similar to how we retrieved the eBay active listings (see article link above), we're going to use the GetOrders call for order (sales) management.

