Zoho

What?
So I thought I'd write a quick article to remind me and to develop a simple notification system that will popup for any user on the submit of a form, or on the click of a button or on the click of a link on a page.

Why?
Because alert (alert task) can only be used on a load of a form, on a change of a field or on the validate process. And because info can only be displayed to an admin and even in some cases only as an additional link in the form. The example below is for use in a customer portal on the click of a report button (report workflow).

How?
This will create a popup using the built-in popup of Zoho creator and gives you the freedom to style the notification as any modal would.

What?
This is an article documenting how to create a Zoho Creator Widget which includes the Bootstrap and jQuery frameworks as well as other JavaScript functionality.

Why?
Quite simply that at time of print (2020-10-24), Zoho Creator does not allow you to use JavaScript anywhere in its app. HTML and CSS are mostly allowed but JavaScript automatically gets removed from any of your code.

How?
As someone who's been using Zoho services and programming in Zoho Deluge for a few years now, even I thought of Zoho Widgets as a daunting task. But after doing some, I realize this is actually very quick to do and much easier than first thought. The article below documents how to create your first widget in a MacOS environment. I aim to create a WindowsPC version of this document at some point for my colleagues. The below instructions follow a fresh install as if this is the first time this computer has created a Zoho Creator Widget.

What?
So this is an article documenting how to create an on/off toggle switch that hides and displays between 2 div layers in a Zoho Creator Page (so not a form or report but a page).

Why?
This is written at a time when Javascript or interactive pages that change on the fly based on a mouse event in Zoho Creator automatically get removed on Save/Update of the page. The following uses the built-in functionality of Zoho Creator and could be seen as a 'Pure CSS' feature. I'm aiming to make a list of capabilities that can be done without loading another framework considering that Zoho Creator has their own version of Bootstrap and jQuery. This is the first example I have where you would want dynamic content in a Zoho Creator page without the use of JavaScript or 'Widgets JS'.

How?
Here are some screenshots to preview what the code below will do, simply copy the code and paste into a Zoho Creator Page.

What?
A very quick article as I couldn't find anything on the WWW to document this error.

Why?
During a data migration, I was using a custom function to copy all the data from one app to another. The specific form was for "Leads" which contained a subform with a product line item list. If I run this code, I would get the error:
Expecting ZC_SUBFORM_250 expression found COLLECTION expression
Another error you may get when using the deluge script is:
LIST value cannot be assigned to 'mySubform'
-- or --
COLLECTION value cannot be assigned to 'mySubform'
or
expecting ZC_SUBFORM_70 expression found COLLECTION expression

How?
Quite simply the error is because the Creator Deluge syntax I was using to insert subform rows was wrong.

What?
Thought I'd put an article here to remind me how to make the retrieval of a record case-insensitive.

Why?
Consider that I have the following creator table:
Product_Name   Product_SKU   
-------------- -------------
MyProduct1     TEST01
Myproduct2     TEST02
myproduct3     TEST03

I'm trying to insert a record for a new product if it doesn't exist in the table but if it does exist then to simply skip adding the product.

What?
This is a not so quick article on how to build up a checkout cart page with Zoho Creator which directs the customer to a Shopify payment page.

Why?
I didn't find anything on the web via Google or Bing that clearly explained how to connect to Shopify API and build the checkout page without making my app into a Sales Channel.

How?
The trick is to actually ignore the Checkout API and the standard error(s) while trying to create a checkout with a storefront access token:
[API] Invalid key or access token (unrecognized login or wrong password)
or how about:
[API] This action requires merchant approval for write_checkouts scope.

Further to this, an order is created when a draft order accepts payment!

Zoho CRM: Update Opportunity Type as New or Existing Business

What?
A quick article on how to get Zoho CRM to update the deal or opportunity type field with "New Business" or "Existing Business" depending on whether this won opportunity is the second time for this account.

Why?
Mainly for reporting purposes. We want ZohoCRM to report on what is repeat business and what is new business. As part of a process, you could get your staff to update the opportunity "Type" to "Existing Business" or "New Business" at the time they update the stage to "Closed Won". If you'd rather that staff don't have to remember to do this, then this snippet of code is for you.

How?
Note that here, the term "opportunity" is synonymous with the "deal". Also note that I have 2 versions of this, the first is if you have Enterprise or Ultimate edition (or Zoho One) which supports functions; the second is further down on the page applicable to Zoho CRM Professional (which doesn't support custom functions).

To be specific, we only want the opportunity type to be updated to "Existing Business" if the opportunity is the second "Won" opportunity against this account.
Zoho CRM: Client Script: Swap Quote Account with Deal Lookup

What?
A very quick article on a small client script to set the Account field on the Quote from a lookup field on the Deal record.

Why?
The use-case here is that I have a client who is a supplier. The opportunity (aka Deal) will be in the end customer's name so it is their name in the Account field. When a quote is raised off the opportunity, the quote needs to be targeted to the distributor/reseller but if you click on the Add New Quote from the opportunity record, it puts the end customer in the Account field (maps Deal Account Name to Quote Account Name).

How?
We want this to happen as soon as a CRM user clicks on the plus symbol or "Add New" in the quotes related list section of the Deal record. In this example, on the Deal/Opportunity record, I have an Account Name field (the end customer), and a "Distributor" (lookup to the Accounts) as well as a "Reseller" (another lookup to Accounts) field. EITHER the Distributor or Reseller field will be populated but this will be the company the quote should be raised for.