Deluge Script In CRM To Deal With More Than 200 Records

Deluge Script In CRM To Deal With More Than 200 Records

Hi,

I have a Deluge script, which works perfectly. We have a custom field in the Campaigns module called Total_Raised which looks at the Donation_Amount field in the custom module, Donations. The idea is to sum up the total of all donation amounts.

However, it stops at 200 records, the Zoho default cut-off, as I understand it. Is there any way of being able to search through more than 200 records, possibly up to 2000? My existing working code is:

  1. void automation.UpdateDonationTotal(Int campaignId)
  2. {
  3.     if(campaignId != null)
  4.     {
  5.         // Fetch related donations for the given Campaign ID
  6.         donations = zoho.crm.getRelatedRecords("Donations", "Campaigns", campaignId, 1, 200);

  7.         // Initialize the total amount
  8.         totalRaised = 0.0;

  9.         // Iterate over each donation and sum the Donation Amount
  10.         for each donation in donations
  11.         {
  12.             if(donation.get("Donation_Amount") != null)
  13.             {
  14.                 totalRaised = totalRaised + donation.get("Donation_Amount");
  15.             }
  16.         }

  17.         // Fetch the current Campaign record to compare Total_Raised
  18.         campaignRecord = zoho.crm.getRecordById("Campaigns", campaignId);
  19.         existingTotal = campaignRecord.get("Total_Raised");

  20.         // Debugging log
  21.         info "Campaign ID: " + campaignId;
  22.         info "Total Raised (calculated): " + totalRaised;
  23.         info "Existing Total Raised: " + existingTotal;

  24.         // Update only if the calculated value differs from the existing value
  25.         if(existingTotal != totalRaised)
  26.         {
  27.             // Prepare data for updating the Campaign's Total Raised field
  28.             updateMap = Map();
  29.             updateMap.put("Total_Raised", totalRaised);

  30.             // Update the Campaign record
  31.             response = zoho.crm.updateRecord("Campaigns", campaignId, updateMap);

  32.             if(response.get("code") == "SUCCESS")
  33.             {
  34.                 info "Successfully updated Total Raised for Campaign ID: " + campaignId;
  35.             }
  36.             else
  37.             {
  38.                 info "Failed to update Total Raised for Campaign ID: " + campaignId + ". Response: " + response;
  39.             }
  40.         }
  41.         else
  42.         {
  43.             info "No update needed. Total Raised is already correct.";
  44.         }
  45.     }
  46.     else
  47.     {
  48.         info "Invalid Campaign ID: " + campaignId;
  49.     }
  50. }
Is there any way we can search more than 200 records and make the calculation? 

      • Sticky Posts

      • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

        Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
      • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

        Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
      • Custom Function : Automatically send the Quote to the related contact

        Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
      • Function #50: Schedule Calls to records

        Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
      • Function #37: Create a Purchase Order from a Quote

        Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,

        • Recent Topics

        • m2 is converted to Kader when switching from Dutch to English

          By default, our company works in Dutch. We sell a lot of products with m2 as a unit. Now we've noticed that if we change the language in Zoho to English, the usage unit 'm2' gets replaced by 'Kader'. We've got no idea why. I'd expect that the translation
        • Adding string / text fields to modules

          I'm working on a custom leads module with a layout for call center agents.  I need to add text fields that are for display purposes only to prompt call center agents.  I haven't found any way to add a field in Zoho CRM that doesn't accept input, ie. is
        • Avalara Integration To Simplify Tax Calculations

          We are delighted to inform you that Zoho FSM now allows integration with Zoho Books accounts that have Avalara integration enabled in them. Designed for businesses operating across different regions and jurisdictions, Avalara ensures tax accuracy by factoring
        • Restrict card movement in Kanban View

          Hello everyone, I’m wondering if there’s a way to prevent users from moving Deal cards in the Kanban view when grouped by Stage. On the Deal details page, I’ve implemented several validations to ensure users cannot change stages until all conditions,
        • Zoho Payroll's USA and KSA editions are available in Zoho One!

          Greetings! We’re excited to share that Zoho Payroll, currently available only in India and the UAE, is now introducing the KSA (Kingdom of Saudi Arabia) edition and the USA (United States of America) edition, and these editions are now available in Zoho
        • How to handle multiple languages (Resume parser, Job opening, job board, career site) ?

          We are looking to bring Zoho Recruit to a market that needs to support 2 languages. The first thing we need to make sure is that the Candidate be flag with the language they speak. This is easy enough make a custom field that as the desire languages.
        • Zoho Sign & Analytics

          Hi, Is it possible to import data from Sign into Analytics?
        • Zoho CRM - Rollup Field for "Total Calls TODAY"?

          Good afternoon, I'm trying to build a field that will track the total number of calls made to a lead in one day. This way i can organise my call queues by this to prioritise leads without an attempt. I can put in a Rollup field for *total* calls made
        • adding attachment in sendmail script where attachment is in a CRM field

          Hi all, I have a custom field of type 'File Upload' in one of my modules in my CRM. I want to include the file in that field as an attachment to an email - which is done from a button on  the 'Results' module. I have created a script and a button to initiate an email from that module. The Deluge scripting window has allowed me to add arguments for all the fields I need to use except for the one file upload type field. My script currently looks like the below (content of the email omitted). As you
        • How to unvoid sales order ?

          Helo, We need to make a credit not from a voided invoice, which is linked to a voided sale order. I can't find a way to unvoid a sale order. There only a way to convert it to a Purchase order instead... The invoice can't be send back to draft because of the voided sale order. From a accountancy point of view, and treacability, we can't make a standalone credit note. What is the usual procedure? Thanks
        • Currency Field Does Not show commas upon entry - leading to inaccurate entries!

          Hello Zoho.. When our sales reps are entering deals and the profit/revenue it is difficult to accurately enter numbers with lots of zeros when there commas are NOT added until the record is saved. Could commas be added to this filed type as it is being
        • Create Funnel to Track Email Outreach Conversion

          Hello, We would like to create a funnel that measures: N° of emails sent -> N° of emails opened -> N° of emails responded We would like to measure this email response conversion rate for each of our SDRs. We use the analytics tool of Zoho CRM and not
        • Zoho Assist not rendering NinjaTrader chart properly

          Hi everyone. Just installed and testing Zoho Assist. I want to display my laptop' screen (Windows 11) on a monitor connected to my Mac mini. The laptop is running a stock trading program called NinjaTrader. Basically, when running, this program displays
        • CRM->INVENTORY, sync products as composite items

          We have a product team working in the CRM, as it’s more convenient than using Books or Inventory—especially with features like Blueprints being available. Once a product reaches a certain stage, it needs to become visible in Inventory. To achieve this,
        • Introducing Assemblies and Kits in Zoho Inventory

          Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
        • openUrl in blueprints

          My customer wants to open a URL at the end of a blueprint transition. Seems this isn't possible right now but it would be very useful. In this thread, https://help.zoho.com/portal/en/community/topic/openurl-not-working the Zoho agent said that it's logically
        • What is Resolution Time in Business Hours

          HI, What is the formula used to find the total time spent by an agent on a particular ticket? How is Resolution Time in Business Hours calculated in Zohodesk? As we need to find out the time spent on the ticket's solution by an agent we seek your assistance
        • Transfer image url from Zoho Forms to Zoho Analytics

          I am storing an image in a zoho form. When I pull the data from the form into zoho analytics the image field does not import. How do I pull in the image url location or the image into Zoho Analytics.
        • Why ZOHO Function Can't Read Custom Field API In Quotes Module (Subform)

          I’m using a Deluge function to transfer data from a subform in the Quotes module to a subform in the Accounts module. Everything works except for a custom picklist field in Quotes—no matter what I try, the Zoho API can’t read that field ("Status_sb").
        • Modules are continuously loading

          Hi! We are not able to open the task modules, it keeps continuously loading
        • Introducing Image Upload Field

          Hello everyone, In this post we will discuss about the benefits and usage of the Image upload field. The field is available for standard and custom modules.  Usage: This field can be used to upload a gallery of images to a record and share the record with peers or customers. The record can be made accessible to users outside of Zoho CRM via Portals, where they can upload the necessary images. Preview, editing, and deleting images: The uploaded images can be directly edited and saved from the record
        • Create multiple leads from a zoho form subform to populate inside zoho crm lead module

          I have corporate clients with numerous employees. When these clients complete our Zoho Form, they can nominate individual employees—providing details like first name, last name, email, mobile number, etc.—using a subform inside the zoho form. Is it possible
        • BCC Dropbox on the Agency Module

          Good morning! We've recently implemented the BCC Dropbox feature on our Zoho CRM, but this only appears to be working on the Leads and Contractor (Contacts) modules. It would be incredibly useful for it to work on our Agency module too as a way of tracking
        • Unable to Retrieve refresh_token from Zoho Self-Client OAuth Flow

          Hello Zoho Support Team, I am currently integrating Zoho CRM with a custom Node.js backend using the Zoho OAuth 2.0 authorization process. I created a Self-Client from the Zoho API Console and generated an authorization code successfully. However, when
        • On create of Amc module get sub form data of last row and update in Schedule Vist End Date field in zoho crm

          @Iswarya B G @Bhoomi Joshi @Abinaya Praveen @Ishwarya SG @Haiku Technical Support On create of Amc module get sub form data of last row and update in normal module field Schedule Vist End Date field in zoho crm
        • Ask the Experts 19: Live Expert Panel Discussion - Inside Zoho Desk Spring Release 2025

          Hello again! Have you ever needed quick insights into key indicators to help manage and streamline specific operations? Have you started using AI to enhance your customer service in Zoho Desk? From configuring simple bots using Guided Conversations to
        • Tip: when "\r\n" not working for new-lines when building a file using the .toFile() function

          As above, ran into an issue - "\n" was working for newlines, but "\r\n" was not working for newlines and carriage returns. Took me a bit but using hexToText("0D0A") in place of "\r\n" resolved this. Including in the forums to save others any drama.
        • Call transcrition working for ringcentral?

          I don't see anything about what telephony providers can be used. The Zoho support person A said that RingCentral isn't supported. Zoho support person B said that it works, just make sure the call recording link works. Excellent instructions here: Call
        • Multiple Pipelines

          Is it possible to create multiple candidate pipelines?
        • Showing meeting acceptances in CRM that originated from Outlook

          Hello Zoho Team, We send meeting invitations from Zoho CRM. Many of our recipients use Outlook and therefore use the RSVP buttons from Outlook to respond. They rarely, if ever, use the RSVP buttons from the Zoho invitation. Unfortunately, the meeting
        • Weekly Tips: Folder Sharing Simplified with Zoho Mail

          Let's say your team is working on a project that requires gathering numerous inputs via email. Your team lead, who manages the project, receives a flood of emails containing critical information. Instead of forwarding each email individually—which can
        • How to add a customized/dynamic Zoho Booking link in email footer?

          We just installed the latest version of the Zoho Desk <=> Zoho Booking extension from the marketplace and are quite happy to see the feature where a ticket-specific appointment booking link can be inserted in a reply. Is there any way to configure this
        • ZOHO BOOKS EXPERT

          We are planning to migrate from Quick Books to Zoho Books, and are looking for a professional with experience in migration to Zoho Books and the setup of Zoho Books. Currently, we have two companies and two Quick Books accounts, and we want to integrate
        • Add export option that only export one or selected notebooks

          Currently the export function will export ALL data every time, this not only wastes user bandwidth, disk I/O and local storage space, but also consumes more resources on the server. Partial export should be a very basic and easy-to-implement feature.
        • Power of Automation :: Design your Ideal Task form with Task Layout Rules.

          Hello Everyone, Use case:- One of our customers, who is managing their entire workflow in Zoho Projects wanted to dynamically display task fields based on the type of task being created. For instance, if a task falls under the "Shipment" category, only
        • Master account and move under member account How do I do it?

          I have a master account with a customer on which the customer has 4 sales points located in different places around them that I would like to add to my Master account under the member account but I can't figure out how to add them since they are currently
        • Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.

          Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.
        • Quoted item subform setup button missing to add back unused field. (Zoho CRM professional edition)

          With Zoho CRM professional edition, understand that we couldnt further customize subform. But i notice there is no setup button for me to add back unused field that i accidentally removed (Tax field). it doesn't appear on left panel unused field as well.
        • Updating Zoho Multi-Select Lookup via Deluge Script

          I need to copy the ID of a lookup field (Match_with_IP) in the to the ID of a multi-select lookup field in the contact (Match_with_IP). I have the following script: record = zoho.crm.getRecordById("Contacts",ID); M_record = zoho.crm.searchRecords("Deals","(Matched_with_GC:equals:"
        • Cliq iOS can't see shared screen

          Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
        • Next Page