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

        • Emoji Support in Bigin CRM

          We request the implementation of emoji support across Bigin CRM. This feature should allow users to seamlessly use emojis in text fields, headlines, and deals. It would enhance communication, improve the visual appeal of records, and bring more personalization
        • Does Zoho Learn integrate with Zoho Connect,People,Workdrive,Project,Desk?

          Can we propose Zoho LEarn as a centralised Knowledge Portal tool that can get synched with the other Zoho products and serve as a central Knowledge repository?
        • Workdrive API Get list of Sub Folders not working

          Hello Workdrive API "et list of Sub Folders" not working. Can you please check this. https://workdrive.zoho.com/apidocs/v1/teamfolder/getteamfolderfolders
        • is there a way to add tag in the "form rule" so that the email workflow can be automated through zoho begin for that perticular response?

          I have a form rule; based on which the response like a program to be sent via begin workflow. How do i do that?
        • Email address with + char is incorrectly invalid

          cannot enter contact with email address containing +, i. e. valid+email@example.com. this is a perfectly valid email address by but fails Zoho Campaigns validation. https://en.wikipedia.org/wiki/Email_address#Local-part
        • Update Regarding Zoho Finance Applications' Domains For API Users

          Hi users, Until now, both the Zoho Finance apps and their APIs shared a common domain. We've recently introduced separate domains for APIs. You can now start using the new domains for API calls. The old domains will not work for API users starting April
        • Zia powered by GPT is already available for MExico?

          Hi there! Is Zia powered by GPT is already available for MExico? I have Zoho ONE membership is Zia powered by GPT compatible with my membership? What's the specs? Do I have to get Chat GPT Plus plan? Thanks!
        • Adding a Download field to a form

          I want to set up a form on my website so that people can download a pdf file once they have submitted their email details. It has been really easy to set up the template but I cannot locate a field with the function. I can see file upload, but not download. This is the main task I want to add to my website as part of the "sales funnel" so hope there is the option.
        • Campaign Edit - Vertical Align Text to Center

          I have a layout in one of my campaigns that is using the split box with a picture on the left and text on the right. I can't find where I can vertically align the content of these boxes. It's forcing my text to be at the top vs centered. Am I missing
        • Introducing Dark Mode / Light Mode : A New Look For Your CRM

          Hello Users, We are excited to announce a highly anticipated feature - the launch of Day, Night and Auto Mode implementation in Zoho CRM's NextGen user interface! This feature is designed to provide a visually appealing and comfortable experience for
        • is it possible to pull the landing page and email campaign from Zoho app to Zoho marketing? Can I get all the benefits that exclusive app that offers in ZMA?

          There is a exclusive Zoho apps for landing page design, email campaign, and same features are there within ZMA as well for to setup landing page and email campaign. can ZMA offer all or limited features of those apps? I request please provide demo and
        • Enable 2FA / MFA in Bigin

          Hi, Our company started using Bigin. I (sysadmin) want to require MFA for Bigin as some users also have integrated their calender and mailbox into Bigin and regardless of that, in general, MFA logins are preferred in our company as it strengthens our
        • Forwarding Zoho Desk Support Email to a different e- mail

          Hello, I am using ZohoDesk and I have a Zoho Desk Support e-mail setup. I would like to know if there is a way to forward the e- mail inbound to this Zoho Desk Support e- mail to a different e- mail?  Thanks!
        • We are being overbilled by Zoho and they refuse to correct it

          We are being overbilled for CRM Ultimate Add-on. Zoho has acknowledged that they know this, but refuses to address and issue billing credits for the amounts we have been overpaying. Our company has been downsizing (unfortunately) and in the past 3 months
        • is there a better way to routinely export my project timesheets?

          Hi there, I am somewhat happy with how Zoho books handles time.  One thing that is missing is more user driven control over my data.  I have a workflow where I constantly need to give customers feeds of work done.  So I pick a project, and would ideally
        • Does the ability exist to make tax on the customer profile mandatory?

          I am reaching out to inquire about the possibility of making the "Customer Tax" field mandatory when creating a new customer in Zoho. We want to ensure that all customers have their tax information recorded to maintain compliance with our internal processes.
        • Triggering rules on lead conversion

          There is no field on the Rule list for rule conversion to trigger an alert on liead conversion to a potential. I assigned a rule to file on any creation or update of a lead. The lead was changed a lead to a potential but no rule was fired. Rajesh Bhadra
        • How do you remove a user from SalesIQ?

          I have a user in Sales IQ who needs to be removed (she's no longer involved with sales and chat) but I can't find any way to remove her. How do I do that?
        • Bug with Zobot Human transfer

          I have configured the brand, the operator, and the Zobot in Spanish. However, no matter what I do, it always says "YES" instead of "Sí" or "Sure, why not " instead of "Claro, ¿por qué no?" when asking if the user wants to contact a human operator. The
        • Integrate SalesIQ with tiendanube.com

          Tiendanube.com is the leading e-commerce platform designed to help businesses create and manage online stores. It provides tools for entrepreneurs and companies to set up, customize, and operate their online shops with ease. Tiendanube is particularly
        • How to reset Zoho Commerce

          Hi, we are preparing a new onlineshop connected to commerce and books for going live in the next days. Now we want to delete all tests and transactions we made within the development process. And also add a new tax rule which is not possible at the moment
        • Free webinar: ‌Zoho Vault in 2024—A live Q&A with our experts

          Hi everyone! 2024 has been a pivotal year for us, taking our journey from a basic team password manager in 2013 to a full-featured security platform offering password management, single sign-on (SSO), and soon, passkey management. Our team has been tirelessly
        • Kaizen #167 - Configuration and Initialization of Zoho CRM Python SDK (V7) for different client types

          Hello everyone! Welcome back to another week of Kaizen! Zoho CRM Python SDK allows developers to integrate Python applications with Zoho CRM. In today's Kaizen post, we will explore how to initialize and configure the SDK for both self-clients and server-based
        • Zoho Forms - Dynamic Prefill Setup Question

          Hello, I'm very excited about this feature. So much I'm learning about webhooks. However, it seems that the webhooks I can obtain from Zoho Flow and Zoho CRM come with already parts in the URL that are put as invalid by the GET Webhook URL. Do I need
        • How to get a list of Team Folders associated to a Project from the API?

          I've tried the below, based on another article and was unsuccessful. response = invokeurl [ url :"https://projectsapi.zoho.com/api/v3/portal/" + _portalID + "/projects/" + _projectResID + "/folders" type :GET connection:"zohoprojects" ]; info response;
        • Email Alert attachments unavailable for Vendor Payments

          I have several vendors with country specific compliance requirements to support the payment of their invoices. I've created Vendor Payment templates to meet their requirements and I setup an automation workflow that gets triggered when the invoice is
        • How to create Sepa Direct Debit XML file: solution and code

          Even though Books provides a payment integration for Stripe and Gocardless (in Europe) there are customers that want to use the Sepa services of their own bank. Mainly because Stripe and Gocardless are quite expensive. In that case they would need a Sepa
        • Exporting Project Tasks

          I can export the gantt chart to a nice PDF in colour, but we want just the task list in a nice colour layout. Is there a way to export it to PDF without the gantt? It would be perfect to give to clients.
        • bug reporting with the count of linked Desk tickets

          I am aware that when viewing an individual bug, you are able to see a count of the Desk tickets that are linked to the bug on the right hand side. However, I cannot see a way of reporting this figure from a list of bugs. Our use case is that we would
        • Unable to send e-mails to an specific address

          Hello. I'm having problems sending e-mails to my shipping company. user@shippingcompanydomain.com INVALID_ADDRESS, ERROR_CODE :550, ERROR_CODE :5.1.1 <user@shippingcompanydomain.com>: Recipient address rejected: User unknown in virtual mailbox table Reporting-MTA:
        • Emails linked to Deal

          Hello everyone, I’d like to ask a question to see if someone can help me out. We are requesting availability from suppliers by sending emails directly from the Opportunity. These emails we send are logged within the Opportunity; however, when we receive
        • Blueprint transition help needed

          I have 5 approvers. For a stage to be passed to the next stage, I require any 3 out of these 5 approvers to make the approval. There is no particular sequence of approval, at any one time, any one can approve. As long as 3 approvers approve, the stage
        • Year-End Wrap: Out-of-Office Made Easy with Zoho Mail

          As we wrap up 2024, now is the perfect moment to take control of your email routine and gear up yourself for a productive and successful new year. We have curated a series of weekly tips to help you master your email management starting today. Watch out
        • Creator Simplified #9: Automatically Sending Uploaded Files as Email Attachments

          Hey Creators, Welcome back to the Creator Simplified series! Today, we’ll explore how to automate file uploads as email attachments in Zoho Creator a handy feature that saves time and reduces manual effort in your business process. Use Case: In a typical
        • Zoho Books Community Meetup: Learn, Grow, Network!

          Hello users! We are excited to announce a series of upcoming Zoho User Group meetups and would love for you to join us! This is a great opportunity for you to connect with other users, share experiences, and learn more about how to make the most of our
        • Bar chart from Deal Stage Snapshot table not showing right amounts

          Hi, since we needed to track the changes of our deal pipeline over time, I added a new data source and selected 'Snapshots' to start the sync. At first I thought it was working just fine, after a few days I realized that something was wrong with the amounts
        • How to Display Territory Field on Deal Object

          I am assigning Territories to Deals. I am able to use the Territory field as a column in my list view but cannot figure out how to enable it to be visible when viewing a Deal record directly. Can you advise on how to display the territory assignment as
        • Power of Automation::Automate the process of creating Tasks from Task template on project status update.

          Hello Everyone, Here we are again to share another requirement that has been accomplished through the implementation of custom functions. A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed
        • Im Stuck in an EDIT ONLY WITH WIZARD issue

          So I found Wizards to be a really helpful tool in minimizing the exposure of redundant, superfluous fields to staff that would never otherwise have to edit those fields. My issue is, that when the record (in this case a lead) is created with a wizard,
        • Mass Update in Zoho CRM

          Hello, I want to update my past update records by using deluge on some conditions. anyone can please tell me how can I do it.
        • Next Page