Customer Relationship Management Systems

Zoho Survey: Zoho CRM Webhook

What?
A separate article as a follow-on from my previous article in this series Zoho Survey & Zoho Analytics: Query to generate individual responses and grouped pages which may have grown a little but just wanted to record how to receive a Zoho Survey response in a Zoho CRM REST API function.

Why?
As above, didn't want to overload a single article with all the answers of one development but this one may be referred to separately. I want a Zoho Survey when submitted to be parsed by a Zoho CRM REST API function.

How?
First, I'll go through the steps of setting up the Zoho CRM function, we'll convert it to a REST API function which will give us a URL and then we'll configure the Zoho Survey to trigger a webhook when submitted.

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.
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.
ZohoCRM Client Script: On Change of Dropdown: Subform Rewrite: REST Function

What?
An article on a client script used in CRM which is a working example of rewriting a subform (line items of an invoice) and calls a REST API fuction to return the custom fields of the line items. Pretty much a function which took me a day to write.

Why?
As mentioned, it took me a while to write and I would like to use it as a reference for when I forget how to do this.

The use-case here is that we have a dropdown/picklist on a CRM invoice record that has the options of "Deposit" and "Final Balance". This rewrites the invoice line items to represent a deposit or a final balance invoice with the deposit deducted. Because these line items have custom fields, we need to copy over all the custom values to the new line items.

How?
This is about an hour's work doing it on a CRM workflow (save of record) but here we're going to do it in client script:

Zoho CRM: Remove Duplicate Product Records

What?
An article on removing duplicate products within ZohoCRM.

Why?
Product duplicates are a common issue during development, especially when we have products imported via a feed or API or simply by staff and their spreadsheets. There is a deduplication feature for leads and contacts but not for products.

How?
There may be a better way of doing this. What I'm trying to have is a generic function that will work on any CRM and possibly be quick to adapt to a module other than products.

This function will also try to delete the duplicate but if the duplicate is the one used in a transactional module record (eg. quotes, sales orders, invoices, purchase orders), then it will delete the older one (referred to as keep ID).

Another point is that this is using COQL to sort the records and tries to keep the first version of the record (sorted by ID ascending) and will attempt to delete the other records which match on product name.

I would recommend commenting out the delete commands and leaving the info commands to preview what records it will delete. I also recommend doing a data backup beforehand.

ZohoCRM GetRelatedRecords INVALID_DATA

What?
A ridiculously quick article on resolving a zoho.crm.getRelatedRecords() combined with a zoho.crm.bulkUpdate issue.

Why?
Trying to be clever and reducing the API calls to go through a few thousand records and to update the related records. I was getting the error INVALID_DATA with the details being api_name:'data'... But this is shortcode, not an invokeURL.

{ "code":"INVALID_DATA", "details":{ "api_name":"data" }, "message":"invalid data", "status":"error" }


How?
I recall covering this solution before but it boils simply down to the zoho.crm.getRelatedRecords() not retrieving related records which are clearly visible when using the CRM.

Zoho CRM: Make Upload File Field Mandatory

What?
A quick article on making an "upload file" field mandatory.

Why?
Because for some reason, it wouldn't appear as selectable when I tried using a layout rule. Probably everyone else has figured this out and I'm just late to the party.

How?
Through the wonders of Zoho CRM Client Script.

So we're going to check on page onload, onchange for the Create Page (Standard), Edit Page (Standard), and Details Page (Standard).

Zoho CRM: Updating a CRM record using API v7

What?
This is a quick bit of code for my reference so that I don't have to keep finding a function that gives me the syntax of how to either create or update a record using invokeUrl.

Why?
Because my designers keep including custom fields in their transactional modules line items (quotes, sales orders, invoices, purchase orders). The only way to update these are by using the API and deluge function invokeURL rather than the usual shortcode of zoho.crm.updateRecord() or zoho.crm.createRecord().

How?
This is somewhere in the official documentation but here's the bits that I need: