Deluge help - Looping in Zoho CRM

Deluge help - Looping in Zoho CRM

Hi! I am trying to create a function and struggling as I cannot get the function to repeat without. breaking.

Trying to write a function (currently doing through schedule) to run daily. Searching for tasks that are 90 days or more overdue. If task is 90 days or more over due the Task Owner will change to a new user (specific user id supplied in code). 

The problem is the 200 record limit. How do I get this to loop? 

1. Testing based on 1 users tasks (script below) to another specific user id
2. Once the first script works I want to implement it to all users across the organization


void schedule.Test_Overdue_Tasks()

{

tasks = zoho.crm.getRecords("Tasks",1,200);

today = zoho.currentdate;

overdue_threshold = today.addDay(-90);

for each  task in tasks

{

due_date_str = task.get("Due_Date");

if(due_date_str != null)

{

due_date = due_date_str.toDate();

info "Task ID: " + task.get("id") + ", Due Date: " + due_date + ", Overdue Threshold: " + overdue_threshold;

if(due_date <= overdue_threshold)

{

// Modified to include exactly 90 days overdue

owner_field = task.get("Owner");

// Fetch Owner field directly

if(owner_field != null && owner_field.containsKey("id"))

{

owner_id = owner_field.get("id");

expected_owner_id = "4736246000017109001";

// Expected owner ID

info "Task " + task.get("id") + " current owner ID: " + owner_id;

if(owner_id == expected_owner_id)

{

update_map = Map();

owner_map = Map();

owner_map.put("id","4736246000001133001");

// New owner ID

update_map.put("Owner",owner_map);

update_response = zoho.crm.updateRecord("Tasks",task.get("id").toLong(),update_map);

if(update_response.get("status") == "success")

{

info "Task " + task.get("id") + " ownership updated successfully.";

}

else

{

info "Failed to update Task " + task.get("id") + ". Error: " + update_response.get("message");

}

}

else

{

info "Task " + task.get("id") + " does not belong to the specified owner. Expected: " + expected_owner_id + ", Found: " + owner_id;

}

}

else

{

info "Task " + task.get("id") + " Owner field structure: " + owner_field;

info "Task " + task.get("id") + " does not have a valid Owner id.";

}

}

else

{

info "Task " + task.get("id") + " is not overdue.";

}

}

else

{

info "Task " + task.get("id") + " does not have a Due_Date.";

}

}

}



      • 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
      • 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,
      • Function-2: Round-Robin assignment of records

        Welcome back folks! Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method. Business scenario: Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules. Prerequisite: You must create a permanent record in the

        • Recent Topics

        • TeamInbox down?

          Hi everyone, we are getting message "Sorry, this action cannot be performed due to an internal error. Please try again later. We are on the Canadian data centers. Can someone please confirm if the service is down? Thank you! F
        • Increase subscription prices for existing subscriptions

          Hi, Does anyone know how we could achieve the ability to increase the subscription fee for our existing customers based on a % increase. We are not yet using Zoho Billing (Subscriptions) and I'm not sure if it is a good fit for us. But we would need to
        • Purchase Requisition in Zoho Books

          I want to understand if Zoho Books is having the following workflow: PR ( Purchase Requisition ) >> PO ( Purchase order) >>  GRN/SRN ( Goods/Services receipt note) >> Bill
        • Stop adding Default ID column to xls exports

          When anything is exported to xls, Zoho adds a column with an ID.  WE DO NOT WANT THIS COLUMN.  We use an automated report to a team.  We have our own tracking number.  1. This makes the report messy, it just pushes OUR data off to the right.  2. We have
        • Confirmation prompt before a custom button action is triggered

          Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
        • Marketer's Space: Streamline marketing and sales by integrating ZMA's Planner with Zoho CRM

          In a competitive market, clear goal-setting and seamless campaign execution are crucial for marketing and sales alignment. When integrated with Zoho CRM, Zoho Marketing Automation's Planner enables marketers to create, manage, and measure campaigns effectively
        • Spell Check default language

          Hello All, Is it possible to set the Spell Check default language? I can't find it in the settings. Thanks a lot! Levente
        • Change Last Name to not required in Leads

          I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
        • Custom emails for Portals not working

          I changed the standard templates to custom email templates for all three options, but the invitation is still sending the original email layouts. Anyone know why this would be happening? I changed them 2 days ago.
        • Switching scheduled webinars from Live to On-demand

          Now that On-Demand webinars has been added as an option for webinar presenting, is there a way I can edit already scheduled webinars from Live to on-Demand? These scheduled webinars already have people registered. Thanks
        • Zoho CRM v2.1 deprecation or sunset plans ?

          Hi Team Wanted to know if there is any plan to deprecate v2.1 CRM apis https://www.zoho.com/crm/developer/docs/api/v2.1/ and if yes by when
        • Forex Bank Refund Entry

          Hello, please advise how to enter refunds from our bank forex department. The refund was because we were on preferential rates but at the time of USD purchase were not given the preferential rate, therefore the bank calculated the excess that we paid
        • Auto-Populating Custom Field

          This is to request a feature enhancement for our invoicing system. We're currently creating invoices with a single item per invoice and have a custom field called "Related Vehicle." We would like the "Related Vehicle" field to be automatically populated
        • How can i Customize Delivery Note?

          I need to customize delivery note like change the tittle for language purposes and also include only the balance due
        • Delivery note template

          We have some reasonable templates for sales docs but the delivery note one is very limited. It would be nice if we could have the same options as the sales form templates or even create our own by cloning an existing sales template, modifying (ie: removing
        • INTERCOMPANIES INVOICING

          Dears , I paid expenses on behalf of our sister company from my cash account , then month End i issued an invoice to the sister company , my question is how to put the expenses GL in the invoices
        • How to Add Break line / Return on button click

          I need to return the text concate with difference field from lead with line break i try "\r" ,"\n" "<br>" return "ali \r\n <br> baba"; None of above work.  i expected result something like this  ali baba but got this  ali \r\n <br> baba so, how can i
        • Zoho CRM Theme Color?

          I've read multiple articles stating it's possible to change Zoho CRM theme colour (top menu bar) from personal settings menu, however, my zoho has no options for this at all and I've looked everywhere........has this feature been removed? I'm currently
        • How can i force the user to select a project when creating an invoice ?

          Hello I tried all the ways that i know , but no way is able to stop creating an invoice without project.
        • Sales

          1/ How can I make a discount on invoice exmple : invoice 5,100 le , custmar pay 5000 and I need to make this 100 le as a discount , how can i make it ?! 2/ Is thare any report can make me match my company’s balance with the customer’s balance?
        • Include Project Hours when Creating Estimates from Projects

          Hi Currently, in Books, you can create estimates from Projects by inserting tasks that pull both the task and the hourly charge rate. But it doesn't pull the budgeted hours for the task, so you manually have to remember the number of hours for a given
        • acc

          Regularly sending statements to customers is an imperative part of many business processes as it helps foster strong customer relationships and provides timely guidance on pay//
        • South African Payment Gateways

          Since the "Demise" of Wave many South African users have moved over to Zoho and yet for years users have been requesting Integration with a South African Payment Gateway to no avail. Payfast was the most commonly requested gateway as it supports recurring
        • Calendly does not show scheduled Meetings

          I use Calendly as my standard booking tool, but no matter what I am doing, Calendly shows any appointment as free (when in fact there already is an appointment in CRM Calendar or Zoho Calendar). Drives me nuts - cannot go away from Calendly due to various
        • CRM Implementation

          I need to implement Zoho CRM. Is there a useful user manual available to guide me through the implementation?
        • Automate data upload process like reports

          I'll start with the end in mind.  I want to basically keep certain creator tables updated with data that are in a sql database/tables in our office (employees, active jobs, employee positions) so I can reference that data and not have to duplicate it by hand every time someone adds a new job or employee in the office desktop software.  Here are some thoughts I had about how to do this, but am unsure as to whether any of them are actually possible and how to go about it from there: Is there any way
        • Zoho Creator Upcoming Updates - December 2024

          Hi all, We're excited to be back with the latest updates and developments on the Creator platform. Here's what we're going over this month: Deluge AI assistance Rapid error messages in Deluge editor QR code & barcode generator Expandable RTF and multi
        • Zoho Social integration with Zoho Flow

          Is there any plans for Zoho Social integration with Zoho Flow?
        • Custom API - Need to create a string return value, not only MAP

          @Support: When creating a Custom API it only allows a return from a function of MAP type. The service I'm using requires a string return, how can this be achieved?
        • How can I insert and update field data of a sub-form without adding data into the main form’s mandatory fields.

          1. I have a main form that contains a sub-form. I need to update the data of the sub-form from a function, but I am unable to do so. How can I achieve this in Zoho Creator? 2. How can I insert data into a sub-form without inserting data into the mandatory
        • Marketing 2.0 has been a catastrophe

          Anyone else having significant issues with their link between their CRM and Marketing automation since moving to version 2.0? We had an easy flow for triggering leads in the CRM to journeys in Marketing Automation but now nothing seems to work properly.
        • Pop Up

          Hello, I want to automatically display the information of the attached data in the product module in the related list section of my data in the lead module when the current time matches the "Call Time" field of my data in the leads module. How can I achieve
        • Cannot average "Duration (Time)" from Pick List History Tracking in Reports

          Okay, let's say I have a custom module. In this custom module I have a pick-list named "Status" with "New", "In-Progress", "Completed" values. I also have turned ON pick-list history tracking and chose "Time" to track the duration in (instead of "Calendar
        • Field Update: can't find a custom multi-line text field in the options list

          I want to update a custom text field (large size multi-line: 32000 characters) that I have added in the Accounts module using this functionality https://help.zoho.com/portal/en/kb/crm/automate-business-processes/actions/articles/field-updates , but I
        • Authorize.Net Update: Disable Transaction IP Velocity Filter to Avoid Payment Failures

          Update: The Authorize.Net integration was updated on November 20, 2024. To prevent recurring transaction failures, we recommend disabling the Transaction IP Velocity Filter at the earliest. We’re updating the Authorize.Net integration in Zoho Books on
        • Need to send a single email to up to 20 recipients

          I want to send a single email to ~16 or 20 recipients. It appears that I cannot do this in Zoho email as it gets flagged as unusual activity. I need to be able to communicate with this group on a regular basis. What am I missing that Zoho doesn't allow
        • Whatsapp Limitation Questions

          Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
        • Note not being pulled for other modules in email template

          Hi there, Currently i am creating an email template that is able to pull the data from notes field in estimate module and email it to procurement team where they will be able to receive the email with the contents of the note, i am unable to replicate
        • Unable to Schedule One-to-One Emails in Zoho CRM

          Hi everyone, I’m using the Zoho CRM Professional Edition and facing an issue with scheduling one-to-one emails directly from CRM. While I can send immediate emails without any problem, I don’t see an option to schedule these emails for a later time. I’ve
        • Canvas Detail View Related List Sorting

          Hello, I am having an issue finding a way to sort a related list within a canvas detail view. I have sorted the related list on the page layout associated with the canvas view, but that does not transfer to the canvas view. What am I missing?
        • Next Page