Customer Relationship Management Systems

Zoho CRM: JS Widget: Generic Script to pass the Record ID to a CRM function

What?
There's documentation out there but as this took me a couple of days to simply install a JS widget hosted by Zoho and pass the record ID via a button to it, I'm adding it here in case I need to refer to it in future.

Why?
We have an Accounts module which holds all the companies we deal with in our Zoho CRM. I want our sales team to be able to click on a button off the CRM account record which will call an API returning all the credit information about a company. Unfortunately, if you do this simply using Zoho Deluge in a button, there are no new lines/carriage returns or styling that you can apply, which pops up as a message box to the sales person; but all on one line and not that readable. Using a JS Widget, we can popup a window over the Zoho CRM which displays a more clear HTML & CSS styled message box.

How?
There are links to how to create a widget in detail which I'll link to at the bottom of this page. What follows are the quick steps to create a widget.html file and how to get whatever the Zoho Deluge CRM function returns.
Zoho Books: Get Invoice Payment Terms via API

What?
A quick article on getting the payment terms in Zoho Books along with their IDs.

Why?
I often need to send through an automatic payment term on the creation of an invoice but lots of my clients set their due dates differently.

How?
The following snippet of code will query the metadata api in Zoho Books and return a JSON of what the payment terms are.

Zoho Deluge: Connect to Shopify

What?
A quick article showing 2 ways of connecting to Shopify's REST API with a custom app.

Note that this is not for an app embedded in the Shopify instance but for a third-party app, such as a Zoho Creator app, to connect to the data within Shopify.

Why?
At time of print, we have woken up to the news that including a username and password, or a client and secret in the endpoint of a URL will no longer be supported in the Zoho Deluge invokeURL task...

This article exists because I spent 2 hours going down the rabbit hole of trying to use OAuth2 and following the usual steps: Grant Code, Refresh Token, Access Token. I also went down the rabbit hole of installing app-bridge and configuring a JWT which was an absolute waste of time with regards to what I was attempting to do.

How?
Let me show you how we used to connect and then what the new code will be. The preamble to both of these is how to get the values to include in the invokeURL headers and payload.
PHP Script: Make your own Thumbnail Generator via API

What?
Looking for an online tool that will take an image and make a thumbnail copy? This article is for me if I ever want to recreate an online tool capable of receiving an image URL and which both generates and outputs a thumbnail image and makes it downloadable via URL.

Why?
Performance. I have a client with about 10k images of products that they want to appear in a dropdown menu of a JavaScript widget. When the user first loads up the webpage containing the widget, 10k images are downloaded. I have put in a lazy loading process where it will load the first few images and as the user scrolls down the dropdown, more are loaded. This still gets buggy on certain mobile devices as some images are over 1Mb.

So I needed a tool that every time a new product is added, a thumbnail gets generated and stored in the same application. Trawling through the first few pages of Google, all the online tools that did the same had a pricing page. I can understand why you would need to limit users so I don't blame them. But if you can, why not make your own?

How?
So you will need a webserver of your own running PHP 8. The following PHP script was only tested using PHP version 8.x so I can't say whether it will work for previous versions.

I cannot take credit for this script, as I asked OpenAI's ChatGPT to write it initially, and to build upon it as I kept moving the goal posts, figuratively speaking, and changing the requirements. I am impressed however that every version it iterated, worked exactly as I asked with only 1 error where it mixed a method with a comment but thereafter, a working script every time.
Zoho CRM: Standard Setup for Tax Rates

What?
This is an article for training purposes. I'm pretty sure there is official documentation on how to do this but I thought I'd write this article to make it simpler for new developers to follow and learn as a quick point of reference.

Why?
Some clients systems will presume that they don't need their sales or CRM users to think about tax and probably manage it in Zoho Books leaving it to their finance team. This is a quick run-through for a standard setup to include UK tax/vat.

How?
Here's a quick step-by-step to follow:
Zoho CRM & Zoho Books: Get Books Currency and Tax IDs

What?
A quick note for when I want to quickly generate maps of a currency or a tax from a client's Zoho Books.

Why?
The use-case here is that we are creating a Sales Order in Zoho Books from Zoho CRM and want to map the correct currency and tax by their ID numbers.

How?
Using the REST API and InvokeURL in Zoho Deluge to look at Zoho Books. This uses up an extra 2 calls so you could run them once, store them as a map on your function if you don't want to use up these 2 every time your sales team push a CRM Sales Order to Zoho Books.
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.
ZohoCRM / Client Script / Canvas: Hide Tab based on Pipeline

What?
A quick article with snippets of code to hide and show certain tabs on a deal record based on the pipeline.

Why?
A request from a customer asked if a tab specific to the pipeline selected can be shown while others hidden. Standard tabs such as Notes, Attachments, Emails, and Timeline should remain.

Code will be needed as a layout rule couldn't control the tabs on a canvas view page. An additional function is needed as the pipeline was not displayed on the canvas view of the deal record but it was on the edit page.

How?
First we're going to add some element IDs to the canvas view page on each of the tabs. Then we'll make an OAuth function that can be executed by the client script which returns the value of the Pipeline given a deal record ID. Finally, we'll have client script execute this function, then show/hide tabs based on the value.

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

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Joes Word Cloud

Please publish modules in offcanvas position.