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

        • How to merge duplicate products?

          merge duplicate products
        • Data not visible in sheet cells

          I'm having an issue where my data is not visible in my sheet cells. If I click on an individual cell, the data does display above in the little "fx" box. But all the boxes in the sheet just look blank. My collaborators do not have this issue. I have checked
        • Rollup summary for custom module

          Rollup summary feature was introduced almost a year ago: https://help.zoho.com/portal/en/community/topic/introducing-rollup-summary-in-zoho-crm-public-early-access-2023 It does not support custom modules tough and this post aims to track such feature
        • Foreign Currency Bank Account

          I have a bank account in USD zero balance but when i run the bank ledger in my company currency in AED it was shown small balance 1.31 AED , how to make it zero also ,Thanks
        • Why don't we have better integration with Mercado Pago or Pagseguro?

          Currently, the integration between Zoho Commerce and Mercado Pago for Brazil is very poor... Since it is old, it does not include the main payment method in Brazil today, which is PIX. Is there a date for this to finally be launched? There are numerous
        • Alert for Back Navigation in Zoho Creator Widgets on Mobile Apps

          In Zoho Creator widgets, when a user navigates back on mobile devices, the data within the widget is reset. This leads to a loss of any unsaved changes or inputs, causing frustration for users. To enhance user experience, we need to implement a confirmation
        • "Trigger flow for each entry" not working

          I've read this article on how to trigger a flow for each entry in my array. https://help.zoho.com/portal/en/kb/flow/user-guide/create-a-flow/articles/webhook-trigger#Trigger_flow_for_each_entry I cannot get the flow to run for each variant in this JSON
        • migrating from Zoho Invoices (CRM) to Zoho Books

          Good day, I was wondering if there was a easy way to migrate all the quotes and invoices from Zoho Invoices CRM to Zoho Books. We plan to move to using Zoho Books in a few weeks and would like to have all the quotes and invoices from the past 3 years
        • Edit specific job page on carreer site

          Hey, I was wondering how I could change the layout of a specific job page? (when you go to the carreer website and then click on a job listed there). When I go to customization I can edit the carreer website but I seem to be only able to edit the first
        • CRM - Clearing a Subform

          I seem incapable of working out subform functions without assistance.  I've searched, but can't seem to find anything that works. I have a subform that gets filled in when a Zoho Sign document is completed but the fields don't match with the original field values held on CRM (I did have it automatically update, but some fields were being filled in with terrible data, so had to put a stop to it).  There are 4 fields on the subform: Field Name Original Value New Value Update Update is automatically
        • How to include GST% in PO amount?

          Currently when I raise PO, the basic price of the item is used. However, the GST is not calculated and added along with the basic amount. I have added a Custom field for GST in the PO but I need Zoho Inventory to calculate the GST amount and add it with the Basic price to give me the final PO price.
        • Automatically add a retainer to every estimate

          Hi all, I've been trying to find a way to automatically add a retainer at a set % to every estimate we create and send. So far I haven't been successful, does anyone know of a way to do this? Thanks,
        • Planning Sales visit to local lead, contacts

          Hello, We have our leads and contacts in CRM. One sale is asking me how he can view all leads and contacts (ideally on a map) in a given area (city or country or "region") so he can plan visiting them. What can be done or need to be developed to have
        • Force Sync Contact/Account from CRM to Books

          Hi all. This might not be a common issue to the large portion of the user base here, but for those who dabble and use CRM and Books integration, they know how painful it is that we have to wait for the 2-hour intervals for the records to sync; especially
        • Workflow for "Expenses" module?

          Hi there, over the last 2 years, Zoho Expense has seen tremendous growth and we are happy with it. But, sometimes it is frustrating to see things are being implemented halfheartedly, or so it seems. For example, There is the possibility to create workflows
        • When is partial reimbursement going to be launched?

          Hi there. I saw somewhere that the partial reimbursement feature is in the work. What is the update and ETA of that? Our clients and prospects have been asking us and we agree that that is an important feature to have.
        • IP Address List > Sigma

          We have developed a ZohoCRM extension that utilizes API calls to our server from Deluge scripts and Widgets. Our API server has IP restrictions in place. To ensure successful communication, we require a list of IP addresses utilized by Zoho's platform
        • Zoho CRM Canvas Copy Original Layout

          Hello all, I want to use Canvas to make small changes to certain views, not to make huge changes. Is it possible to copy the original Zoho layout and set-up and start from there? I checked and all I can find are some templates which are far from the original
        • ZOHO Nightmare

          I am writing as a long-time Zoho user who has faced significant challenges implementing your platform for my business. As a New York-based real estate broker, I have invested over $10,000 and nearly two years trying to integrate Zoho CRM with my WordPress
        • Approval system in Books/expenses

          Hi In Books Is there a way to do the following: 1) Submitter to know the balance in Budget/cashflow before sending the amount for approval? 2) Approver to know the same as 1 above? In Expenses, is the above possible?
        • attaching pdf to a bill using REST api

          I'm trying to attach a pdf to a bill using REST and curl. The problem is the example in that section in the API reference document does not show how to actually submit the file. It only shows the headers used. I've been trying many variations of this
        • How to Open .mbox file in Gmail with Attachments?

          Gmail offer users to backup INBOX folder in .mbox file format via Google Takeout Feature. Howver there is no such option to Restore Gmail MBOX. Thus I would like to suggest you to choose an alternate approach i.e. MBOX to Gmail Wizard. This utility will open .mbox file in Gmail with attachments.  Steps to open MBOX file in Gmail are; Run MBOX to Gmail Wizard Click Add File and add .mbox file. Enter your Gmail login credentials. Click Convert button. Finished! This is how you can open MBOX file in
        • How to create comparison time periods like these examples

          In a Pivot Report I would like to be able to select any date range and show a set of metrics for that date range e.g. revenue, orders, units sold. I would then like to be able to compare to the previous period based on the amount of days on the selected
        • Custom fields for calls and an enhanced call creation form

          Greetings, I hope you're all doing well. We're happy to announce a few recent enhancements we've made to Bigin's Calls module. We'll go over each one in detail. Enhanced call creation form in Bigin What is this enhancement about? This update includes
        • Customize user data collection with User Layouts

          Users denote the people in your organization who work on agile projects using Zoho Sprints. You can add them to your workspace and associate them with required projects. Organizations have distinct requirements in collecting user data. Apart from the
        • Zoho Sites with GoDaddy DNS

          We have a site hosted with www. in front that works perfectly well. The issue is with getting the TLD/naked DNS pointed to the www. while using GoDaddy dns. I have edited the DNS Forwarding entry in the domain so that the root example.com forwards to
        • Integration with Moodle

          Greetings, I hope find all doing well and safe. I've recently returned to using Zoho Flow after a break and was hoping to connect my WooCommerce store with Moodle, the world's most widely used learning management system. My goal was to automatically enroll
        • Possible for "Specify URL Criteria" in URL/Permalink settings to be assigned to a variable?

          I want to embed a Zoho Analytics chart view as a Related List item in the Zoho CRM Accounts module, such that when one is viewing a CRM Accounts module record for an Account, the user will see the chart for that specific company. Is it possible to set
        • How to present an Analytic on a CRM dashboard and filter it on loginuser id

          How to present an Analytic on a CRM dashboard and filter it on loginuser id? I want to display an Analytics pivot table (as a widget) on a CRM dashboard and have the pivot filtered on the loginuser. I want additional user-filters available, such as date,
        • Allow 2 logos for Branding, one for Light Mode and one for Dark Mode?

          Our logo has a lot of black text on it. If we leave the background transparent, per recommendation of Zoho, when a user is viewing a file and turns on dark mode, our logo is not really visible and looks really weird. It would be really great if we could
        • Pre-fill TO and CC fields for Email Templates

          This would be a game changer to be able to set either specific email addresses or merge fields based on deal role titles into email templates. Please pass this along to *hopefully* add to future features of Zoho CRM.
        • Payroll In Canada

          Hi, When can we expect to have payroll in Canada with books 
        • Why can't we associate a contact to mulitple accounts?

          This simple feature has been for 14 years now... it's way past ridiculous. We don't want to add a multiple lookup field, we just want to add a second account to our contact. This way i'll go on Jonh Doe and see in the account field : Company 1 and Company
        • Easy way to delete attachments

          I've reached my data limit and would like to run a view/report, and mass delete attachments. Is there an easy, fast way to do this? Moderation Update: Post Summary: There are two features the post discusses a) Easy way to remove Email attachments Will
        • Calendar Bookings in Recruit

          Hi there, We have recently started using Zoho recruit and although it has some great functionality there are a few gaps that are causing real headaches. One of those being how interviews are scheduled. The majority of our hiring managers are field based
        • Multiple Vendor SKUs

          One of the big concerns we have with ZOHO Inventory is lack of Vendor Skus like many other inventory software packages offer. Being able to have multiple vendor skus for the same product would be HUGE! It would populate the appropriate vendor Sku for
        • Automatic Department and Employee Sync Between Zoho One and Zoho People

          Dear Zoho Support, I'm writing to propose a valuable feature request that would streamline data management and improve user experience within the Zoho ecosystem: automatic synchronization between departments and employees in Zoho One and Zoho People.
        • Delete Unactive Users form Directory

          Hi, how to delete all unactive users ?
        • Changing Related Modules in a Report

          Once a report is created, is it possible to add Related Modules? David Shalev | Chief Revenue Officer | 800 558 9130 davids@splitit.com | www.Splitit.com
        • Is there a way to limit/turn off unlimited Version History?

          We save CAD files in our Zoho WorkDrive and while the files aren't very big themselves, whenever someone hits the save button in the CAD program it uploads another version of the file to the WorkDrive. This means files that are only a few MBs in size can actually be taking up 10s of GB in our WorkDrive if someone is saving frequently. Is there a way to limit the number of versions WorkDrive stores to save WorkDrive space?
        • Next Page