Look up a Contact by email to populate a lookup field on an Account. Note the Map() as the fifth param in searchRecords — required even when unused. The trigger syntax uses a set, not an array.
Standard createRecord call. Build your map beforehand, pass a connection name if calling cross-org. The trigger param controls whether workflows/blueprints fire on creation.
Wrap risky operations in a try/catch, accumulate error state in a flag, then send a formatted diagnostic email at the end. Replace XXXXXXXX with the relevant response variable and fill in the to/subject fields.
zoho.crm.deleteRecord() exists but is unreliable. This invokeConnector approach is more consistent. Swap the module name as needed.
Get attachment IDs from the related list, download each file via invokeurl, then re-attach to the target record. Fill in your connection name and swap the module/ID variables as needed.
Deluge has no native sleep. The workaround: a Zoho Functions serverless Node.js function that waits N seconds, called via invokeurl. Deploy the JS as a standalone function, then call it from Deluge passing the desired delay. Wrap in try/catch — timeouts throw.
The serverless function that powers the timeout above. Deploy this in Zoho Functions as a Node.js function named "Timeout". It reads the seconds param and resolves after that delay.
The native zoho.crm.convertLead() call is limited. This invokeurl approach hits the v7 API directly and gives you full control — pass an existing Contact ID to merge rather than create a new one. Requires a CRM connection with convert permissions.
getRecordById returns multi-select values as a comma-delimited string. updateRecord expects a Deluge List. Use toList(",") to read, pass the list directly to update — do not use toString(";").
searchRecords caps at 200 records per call. Walk pages until a call returns fewer than 200 results. Watch for functions timing out on very large sets — consider batching across multiple scheduled calls.
Call any external REST API with a JSON body. The toString() on the params map is required — Deluge won't serialize it automatically. Set Content-Type in the headers map or the receiving API may reject it.
Notes live in the Notes module. The Parent_Id is a map with the record's id, and se_module is the API name of the parent module. Swap module name and id as needed.
zoho.crm.updateRecord returns the updated record directly — not a status wrapper. The presence of id in the response is the reliable success signal. A missing id or a code key indicates failure.
Each condition must be wrapped in its own parentheses. AND/OR connect the groups with an outer pair around the whole expression. Missing parentheses cause silent failures — the search returns nothing without an error.
Deluge date arithmetic uses addDay(), addMonth() etc. on date objects. For API params and CRM field updates, format as yyyy-MM-dd. Comparing dates requires casting — two strings that look like dates don't compare numerically.
zoho.loginuserid gives the email of the user who triggered the function. zoho.adminuserid gives the org admin. To get the full user record (name, role, profile, etc.), search the Users module — it doesn't come back from the built-in variables.
Anyone who has never made a mistake has never tried anything new.— Albert Einstein