Articles

Zoho CRM Automation: How to Build Custom Functions Step by Step.

6 min read

Branded CodeStringers cover graphic reading 'Custom Functions in Zoho CRM' over a dark indigo gradient.

A custom function in Zoho CRM is a serverless Deluge script that runs your own logic when a trigger fires — updating related records, calling an external API, or automating a step no built-in feature covers. It's how you get the CRM to do exactly what your business needs instead of settling for what's in the box, and it's the everyday work of a good Custom software developer inside the Zoho stack. This checklist covers how to build custom functions in Zoho CRM end to end, from prerequisites to deploy.

Automation like this is where a CRM stops being a database and starts paying for itself — Nucleus Research pegs CRM's return at $8.71 for every dollar spent on a well-run implementation (Nucleus Research). Custom functions are one of the biggest levers on that number, because they replace manual steps that otherwise eat your team's day.

Before you start: three prerequisites

Don't open the editor until these are true — it saves a frustrating dead end.

  • Confirm your edition. Native, write-your-own custom functions are an Enterprise-and-above capability (Enterprise, Ultimate, Zoho One, CRM Plus). On Standard and Professional, functions are only available bundled inside installed Extensions, not authored freely (Zoho). If you're on a lower tier, that's a real constraint to plan around — the kind of thing worth checking with your Zoho CRM consultants before you commit.

  • Check your permission. Your profile needs the Manage Extensibility developer permission to create functions.

  • Define the trigger and the outcome. Know exactly what event should run the function (a record created, a button clicked, a stage reached) and what it should produce. A function without a crisp goal becomes spaghetti fast.

Build custom functions in Zoho CRM

With those in place, the build is straightforward (Zoho):

  • Go to Setup → Developer Space → Functions → + Create New Function.

  • Choose the function type — workflow, custom button, schedule, related list, validation rule, or standalone. This matters: a function scoped to one location can't be reused elsewhere, so pick deliberately.

  • Name it clearly and add a short description of what it does.

  • Click Edit Arguments and map each argument to a module field or a custom value — this is how the record's data is passed into your script when the trigger fires.

  • Write the logic in the Deluge editor. Keep it focused; one function, one job.

A minimal example that copies a deal's amount up to its account:

// arg: dealId (mapped to Deals.Id)
deal = zoho.crm.getRecordById("Deals", dealId);
acctId = deal.get("Account_Name").get("id");
updateMap = Map();
updateMap.put("Last_Deal_Amount", deal.get("Amount"));
resp = zoho.crm.updateRecord("Accounts", acctId, updateMap);
info resp;

Test and deploy

Building the function is only half the job — wiring it up and proving it works is the rest.

  • Validate with Save & Execute Script in the editor to catch syntax and logic errors before anything touches live data.

  • Test with a real record that matches your trigger criteria, and confirm the expected update actually happened.

  • Associate the function with its trigger — for a workflow, that's Setup → Automation → Workflow Rules → your rule → Instant Actions → Function.

  • Deploy and monitor the execution logs and your function credit usage after go-live.

Diagram: the build-test-deploy flow for a Zoho CRM custom function, from defining the trigger and goal through creating the function, setting arguments, writing Deluge, testing, associating it with a trigger, and deploying with monitoring

That test-in-isolation step matters more than it looks. A workflow function that misfires runs on every matching record, so proving it on one record first is the difference between a fix and a cleanup. For deeper patterns, our notes on Zoho Deluge best practices and worked Deluge scripting examples go further than a single function can.

Know the limits before they surprise you

Custom functions run inside guardrails, and hitting one mid-execution is a bad time to learn about it (Zoho):

  • Execution time caps by trigger: 10 seconds for buttons, related lists, and validation rules; 30 seconds for workflow automation; 15 minutes for schedules.

  • 200,000 lines executed per function and a 10 MB response ceiling.

  • A function-credit system on a 24-hour rolling window, scaled by edition and user count — generous on Enterprise and up, but worth watching if you run heavy automation.

Design around these from the start: batch large jobs into schedules, and keep synchronous button and workflow functions lean.

Where to start

Pick one manual, repetitive step your team does in the CRM every day — re-keying a value, updating a related record, sending a templated update — and automate that single thing first. A small, well-tested function that removes real friction builds the confidence (and the internal case) for more.

If you'd rather have that logic architected, tested, and deployed cleanly the first time, that's our day job across the whole Zoho integration surface. Book a free Zoho consultation and we'll map the automations that would save your team the most time — and build them so they fail safely when something upstream changes.

By the CodeStringers Team — Zoho Experts & Custom Software. CodeStringers is a Zoho and custom-software firm writing from work we've actually shipped for clients.

Find out what one connected Zoho system would change in the way you run.

In a no-risk discovery we look at your CRM, finance and operations systems and who owns each part, and show what a connected system would do differently. You pay only if you proceed. Or see how we approach it.

Book the no-risk discovery

More on the same problem:

Frequently asked questions.

When should you use a workflow rule instead of a custom function in zoho crm?

Use a workflow rule's built-in actions whenever they can do the job: email alerts, tasks, field updates on the same record, and webhooks. Reach for a custom function when the logic needs to read or update a related record, call an external API with error handling, make a decision based on several records, or do something the standard actions cannot express. Standard actions are easier to maintain and do not consume function credits.

What are function credits in zoho crm?

Function credits are the daily allowance Zoho CRM gives an organisation for executing custom functions, scaled by edition and user count on a rolling twenty-four-hour window. Each execution consumes credits, so a function attached to a busy workflow can use a surprising number. You can see usage under the Functions area in Setup. If you run out, functions stop running until the window rolls over, which is why heavy jobs belong in scheduled batches.

How do you debug a custom function that fails in zoho crm?

Start with the execution log in Setup, which records each run, its status and any error message. Add info statements at the points where data changes hands, especially after an API call or a related-record lookup, and run the function against a single test record with Save and Execute. Check the argument mapping, since a wrong mapping is the most common cause of a null value. Remove the extra logging once the function is stable.

Can a zoho crm custom function update records in zoho books or other zoho apps?

Yes. Deluge includes integration tasks for other Zoho applications, so a function can create or update records in Zoho Books, Zoho Inventory, Zoho Desk, Zoho Creator and others without writing raw API calls, as long as a connection with the right scopes has been set up. For products outside Zoho, the function uses invokeUrl with a connection. This is how a deal closing in CRM can create an invoice or a project elsewhere.

How do you back up or version control zoho crm custom functions?

Zoho CRM does not provide a built-in version history for functions, so keep the source in a repository you control and copy each change there with a note on what it does and why. Add a header comment in the function itself with the author, date and purpose. Use a sandbox to test changes before they reach production. Without this, the only record of a function is the current version in the editor.

What happens when a custom function hits the execution time limit?

The function stops where it is, the run is recorded as failed in the execution log, and any updates it had not yet made do not happen. Updates it had already made are not rolled back, so a long loop can leave half the records changed. Design around the limit: keep button and workflow functions short, move bulk work to scheduled functions, process records in batches, and store progress so a re-run can pick up where it stopped.

Not yet on Zoho, or already there?

Start a Zoho One trial through our sign-up, or tag us as your Zoho partner for free consulting time every month.

Where we're not the right answer

We'll tell you if we're a fit. If we're not, we'll tell you that too.

  • Your current stack works and nobody wants to change it
  • You want licences resold at a discount and nothing else
  • Your internal team owns the operating model and is not handing it over
  • You want hours of configuration work and nothing run for you: that is on our services pages, and it is not a managed solution
How we start

Most of our best clients come to us with a feeling, not a plan.

"Something isn't working." "We're outgrowing our tools." "We're afraid to make the wrong move." No-Risk Discovery is a short, practical conversation that gets you clarity before you commit to anything big. We'll tell you if we're a fit. If we're not, we'll tell you that too.

Talk to us

Have a question about this?

Say who you are and ask. A person replies within one business day.

The rest of the form follows your answer.

A new client, or thinking about becoming one

Never shared. Never sold.

What are you looking for?An agentic solution (AI OS) is licensed and sold with managed services. An integrated solution is built for a professional services fee. A Service is professional work, done by the hour, the month or the project. Not sure yet is a fine answer.

Tick every one that applies, or not sure yet.

Agentic solutions (AI OS)

Integrated solutions

Services

Platforms you run today

Pick every one that applies. Choosing one is an answer too.