In short
- Native rollup summary fields depend on your Zoho CRM edition and have limits. Check them before you design around them.
- A scheduled Deluge function can count and total anything you can query, and write the results to plain number and date fields.
- Plain fields work in reports, list views, filters and workflows, the same as any other field.
- Page through related records, write only when a value changed, and watch your API credits.
Why Zoho CRM rollup fields need more than the native option
A referral team asks a simple question: which referral sources send us the deals that close? In Zoho CRM, the answer lives on the Deals, not on the Account. To see it on the Account, you need a rollup.
Zoho CRM has rollup summary fields in some editions. Check what your edition allows: the number of rollup fields per module, which modules and relationships they cover, and which calculations they support. When the number you need falls outside those limits, a Deluge function fills the gap.
- Counts split into one field per stage, for example Deals in Intake, Deals Admitted and Deals Lost.
- Rollups through a lookup that is not the standard Account link, like a Referral Source lookup on the Deal.
- Values that come from more than one module, like the latest date across calls, notes and SMS records.
1. Create the rollup fields on Accounts and Contacts
Start with plain fields. The function fills them, so users treat them as read-only.
- Number fields for counts: Total Referrals, and one field per stage you report on.
- A date-time field for Last Activity.
- A date-time field for Rollup Updated, so anyone can see when the numbers were last refreshed.
Set these fields to read-only on the layout for every profile except admins, so nobody types over a calculated value.
2. Write the Deluge rollup function
Pick the records to update
Search for the Accounts or Contacts that need it, for example business accounts used as referral sources. Running on every record wastes API credits.
Get the related records
For each Account, get its related Deals with zoho.crm.getRelatedRecords, or search Deals by the referral lookup with zoho.crm.searchRecords. Both return results in pages, so loop until a page comes back short.
Count and compare
Count deals in total and by stage. For last activity, take the latest date across the modules you track.
Write only what changed
Compare the new values with what is on the record. Call zoho.crm.updateRecord only when something is different, and set Rollup Updated.
Log errors
Wrap each record in try/catch and log failures with the record ID, so one bad record does not stop the run.
Keep credentials and settings, like the stage names you count, in Org Variables instead of inside the code. Then a new stage is a settings change, not a code change.
3. Schedule it, and add a workflow for instant updates
Under Settings > Automation > Schedules, run the function on a schedule that fits how fresh the numbers need to be. A schedule catches every change, including deletes and bulk updates.
Where a number has to be current the moment a deal moves, add a workflow rule on the Deal that calls a version of the function for that one Account. The schedule then acts as the safety net.
Talk through your project
A free call about your integration, your CRM or whatever you are stuck on. Honest advice, even if you never hire us. No obligation.
Three Zoho rollup patterns we build
Referral rollups
Total referrals and referrals by outcome on each referral source Account and Contact, so the business development team can see which sources send referrals and which of those convert.
Deal counts by stage
One field per stage on the Account, so list views and reports can sort and filter by open, won and lost deals without building a report each time.
Last activity
The latest call, note, meeting or SMS across the Account and its Contacts, so you can spot sources nobody has talked to.
Once the numbers live on the Account, they work everywhere: list views, dashboards in Zoho CRM or Zoho Analytics, scores on Accounts, and workflow alerts when a source goes quiet.
Keep the rollup function inside your API limits
- Every query and update in a function uses API credits. Pause any scheduled function you no longer need.
- Limit the search to records that changed or that matter, instead of looping over every Account.
- Skip the update when the values match, so the function writes less.
- Remove old copies of the same function, so two versions do not update the same fields.
Where to start
Start with the one number your team asks for every week, build that rollup, and check it against a report. Then add the next one.
Want it built and tested for you? Book a free call and we will map which rollups you need and where the data comes from.
Want help with this?
Book a free call about your CRM, integrations or reporting, or map your systems first with our free tech stack diagram builder.
