Articles

Humanoid robot looking up some details from a book

What?
A quick article on how to get the pricebook entry using Zoho Deluge for a specific product in your ZohoBooks or ZohoInventory instance.

Why?
This took me the best part of an hour to determine by going through forum posts from 7 years to 2 years ago. The following will work in May 2024 following the API domain change.

The use-case is that the customer wants the item/product rate taken from the item record, if a pricebook is specified and the item exists within it, then it takes the rate from the pricelist. Note that when I refer to pricebook, this is also referred to as the pricelist... and vice-versa.

And in this use-case, my client has added an incredible number of price books/ price lists and then has in excess of 20k items. Previously, the function that would need to get the price book rate post saving a record in Zoho Deluge would fail because it was making too many function statements.

How?
I have this code triggered in a workflow when the sales order is created to do some further calculations based on a surcharge rate held in a custom module. The custom module could only be created in Zoho Books at time of print but Zoho Inventory is where our workflow and code is sitting right now.
ZohoCRM: Daily Follow Up and Remind Record Owner to Convert Lead

What?
An article to ensure I never spend this long on such a request again. The brief is: "Follow up when a lead is created and not converted within 1 day send an email and notification to sales person everyday for 3 days then escalate to a specified user".

Why?
Sorry Zoho! I tried using the interface to set up a workflow or any other mechanisms within ZohoCRM that allowed me to set up a daily reminder to the lead record owner but to no avail. An assignment rule wouldn't work in this case as it had to be the lead owner (there is no owner at assignment rule stage). A workflow email notification doesn't do the popup on the CRM as well. A workflow notify by email didn't give the option to remind daily... only weekly or monthly.

Spent a while trying not to use code but here we are. Code is our friend.

How?
So we'll run a workflow that triggers on the creation of a lead and runs a function which will simultaneously create a task with a reminder both on popup and email which repeats every day until an end date.

We then carry out the last bit of the brief with a separate workflow that runs exactly 4 days after the lead creation time and assigns it to the specified user (full name of user was given in the brief but removed here for privacy).

Finally, we delete any of these tasks when they get transferred to the contact record.

Zoho Creator: Render to PDF with margins and page numbers

What?
There are already articles out there that document this but I use this more and more and would rather just find it on my site than going through multiple bookmarks.

Why?
This use-case is for a customer who simply wanted a quote template to be rendered for PDF or print format. I have another article for a different client who wants a pretty advanced HTML template (well it's a HTML table with rowspans and the borders need to merge cells). But here we're simply going to use ZohoCreator and its PDF rendering options.

What's wrong with just using CSS? It looks beautiful on ZohoCreator pages but then you hit the PDF button and it pretty much vomits your output back to the 90s. The code snippet below is just for a standard template with a modern design.

How?
Ok, admittedly, when first designing the template, there could have been a fair few improvements right out of the gate. Then the client comes back and says things like "can we add this?", "can it say this instead?", "can it be in a bigger font?"... without pushing back too much, it can end up looking like those old websites with HTML tables. We're going to use a HTML table again but that's because I want to send it to the PDF renderer in ZohoCreator and want all the data to stay aligned. Using only DIV layers can cause a few unexpected layouts in ZohoCreator.
Zoho Webhooks & Shopify API: Keep Disappearing

What?
This is an article to show how to setup a scheduled function that checks and restores a missing webhook as well as the snippets when receiving the webhooks and storing them.

Why?
We found that Shopify would intermittently remove our webhooks. This would make the entire synchronization of the system go out of whack and some records would slip through the net while every day, the process to tidy these all up would leave the data more and more unreliable.

So Shopify want your webhooks to respond within 1 second. This is about enough time to store the record but that's it. Processing the record must be done at a later time or in a different process but sometimes it simply will not process it all and respond to Shopify within 1 second.

How?
So let's begin with the code snippets as these might answer your question to begin with and then we'll do the easy bit on how you set this up in the CRM. I'm using ZohoCRM here despite storing the record in ZohoCreator as the app and data processing is mostly done in ZohoCreator. I could have setup webhooks to go directly to Zoho Creator but I don't find Zoho Creator reliable when receiving and responding to webhooks.

Important!: For the REST API to detect what webhooks exist, it can only detect what webhooks it initialized. If you added webhooks via another app or via the Shopify Admin interface, then the following code won't be able to check and restore them.
Zoho Deluge and Wordpress/WooCommerce API: Get All Products

What?
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.
ZohoCreator: Using .toFile and Uploading to a Creator field

What?
This is a quick article on generating a file with the Zoho Deluge function .toFile() and uploading it to a file upload field within Zoho Creator.

Why?
The use-case here is that we want a file to be hosted within Zoho Creator for use by a JS widget that will download the CSV (in this case a Text *.txt) file for use by a dynamic auto-suggester dropdown; one of those fancy ones that includes photos and a bit of fuzzy logic.
ZohoCreator: Basic Widget with Zoho Data

What?
A follow on from my article Zoho Creator: Create a Widget which uses JavaScript back from 2020 with a few adjustments now in 2024.

This widget will only work within Zoho Creator. If you want a solution which sits on an external website and which talks to Zoho, then setup an externally hosted web app with the usual JavaScript frameworks and have it send AJAX commands to a server which reads/writes information to your Zoho instance via API. No need for the Zoho Widget SDK.
Why?
At time of print, I felt the documentation was a little sparse on how to connect a JS widget to the data held in Zoho Creator. Having this example for future use might save me some time. The following is the early version of a JS widget used for a customer and before I added all the layers of complexity, I want to have here an example that demonstrates a basic search on a table of data and returns one record as a result.

The use-case here is that we are enhancing a quote builder form in Zoho Creator. The JS widget (aka the Quote Builder) will need to post a new quote to the system as well as show previous orders.

How?
We're going to use the Zoho Extension SDK. You should refer to my previous linked article but the revised instructions here should also help. Then lastly, I'll post the snippet of code using in the widget to connect to Zoho based on a parameter passed in the URL that a Zoho Creator Page can receive and pass to the JS widget.
ZohoBooks: Error 7008: There are no contact persons associated with this Invoice

What?
A quick article on how to get around this error.

Why?
The use-case here is that I am using the send invoice API and I kept getting this error despite including the customer_id and there was a primary contact on the customer record.
This is from within ZohoCreator, requesting for an invoice in ZohoBooks to be sent.

How?
So the key here is that there were no contact persons on the customer record. Instead, when building the invoice, this had to be added (don't ever remember having to do this) as contact_ids (array/list). Instead the below script will show you how to use this API having a few email addresses as the recipients:

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Please publish modules in offcanvas position.