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

        • 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?
        • Repeatable Fields/Sections in Zoho CRM

          Hi Zoho Team, We have a module in CRM named "Clients". We would like to know whether it is possible to have a feature enables us to have repeatable sections in our clients' profiles? For example, if we customized a section in the clients' profiles named
        • Zoho Analytics: Requests for view access

          Hello, We have a user that might request access to a certain view, report etc. However this request for access is being sent to different admins within the workspace, is is possible to set who the "approver" is of these requests? If not what are the rules
        • Boolean Fields in Mail Merge Displaying as Checkmarks

          I'm really liking the new mail merge functionality. It's replaced the Zoho Sign extension for us. One problem I've seen is that boolean operators (i.e. Checkbox fields) in CRM merge as "True" or "False". This looks a little ugly in my final document — is there a way I can get those to display as checkboxes?
        • Formula in Sub Form

          Hello - I have created a sub-form and the data is going to be insurance policy information. However some of the policy amounts are based on a percentage of a main coverage. For example, Debris removal coverage is 5% of the main dwelling policy. Is there
        • Zoho cases and remote work api

          How to use zoho cases listing api? When i try to hit the endpoint specified in the docs , i get the error : the page you are looking for does not exist with a 401.
        • Email alias already exist

          Hello, I'm getting an error message the email alias already exist when attempting to add 2 email addresses. The emails are associated with an account I deleted. I started a new account and need to add them back to get 1 email at each. I have an open ticket
        • Migrate emails from a shared mail box to a private mail box

          How is possible migrate a shared mail box if the migration tool require a password, and the shared mail dosent have ?
        • Support poor service

          I just wanted Zoho support to give me some more concrete answers. I’m facing SMTP error issues, and they told me that the South American IP was experiencing problems, but they didn’t provide an estimate for when it would be resolved. Now my company is
        • Zoho say my domain seems to be already associated with another account

          I created a zoho account for try my domain mail configuration. When I want to add my domain in this page https://mailadmin.zoho.com/hosting?plan=free then this shows an error that is "This domain is already associated with this account a*****n@f*****."
        • Incorrect Device Time

          Hi On my windows laptop I can't sign into Zoho mail due to "incorrect device time". I'm in Toronto, Canada. How can this be resolved?
        • Get user images by API

          Hi For our internal management software, I want to retrieve user photos via REST API: curl --location --request GET 'https://profile.zoho.com/file?fs=thumb&ID=<zoid>' \ --header 'Authorization: Zoho-oauthtoken <token>' The token has `profile.userphoto.ALL`,
        • Depois de 1 ano não consigo receber e-mail

          Consigo enviar e-mails mas não estou recebendo nenhum e-mail isso aconteceu pontualmente após eu completar 1 ano de uso. Me ajudem por favor
        • Submitted form URL

          I am using the feature "Include a link to allow respondents to edit their responses" for the first time. This URL is included in the email sent to the user after they press Submit. If a form is Saved, there is a section called Partially Saved Entries
        • Function for Emails tranfer from Lead to Deal

          Hi Due to the fact that my Deals conversion needs to be done in 2 ways - depending on the fact if those records already exists or not - resources in fields are different. I am making function control conversation for Leads but I have problem with transferring
        • Create a new immigration service- Similar to immigration law software

          It will be good if you can build a new service. Data will be pulled from the employee form. Then automatically users should be able to complete immigration forms like I 129, ETA 9089, ETA 9035 E, G- 28, W4, I 9 PDF forms and then be able to send for signature with Zoho sign. Immigration Softwares like docketwise can be used for ideas. The advantage with this it sits within Zoho people and employees don't have to feed data in another system
        • Accessibility in Zoho CRM: Not just a feature—a way to empower

          For instructions on setting up these controls, please check this help document: Configuring accessibility controls. Hello everyone, Today (December 3, 2024), on the International Day of Persons with Disabilities, we begin our journey towards a CRM that
        • Zoho Meeting very bad video quality

          Hello, I need 1080p HD on my Zoho Meeting as explained here: Low Resolution/Quality Video (zoho.com) Currently, video quality is lagging with 400mb internet which is not acceptable for my business. My 1080p 60FPS webcam performs well on platforms like
        • Contacts with Deals not appearing.

          What: I simply want to see all of the contacts that are tied to an open deal Problem: In Contacts Module > When filtering on Contacts with an open deal, Zoho only shows some Contacts instead of all. Details: More specifically, I should have ~200 contacts
        • Auto-sync field of lookup value

          This feature has been requested many times in the discussion Field of Lookup Announcement and this post aims to track it separately. At the moment the value of a 'field of lookup' is a snapshot but once the parent lookup field is updated the values diverge.
        • CRM limit reached: only 2 subforms can be created

          we recently stumbled upon a limit of 2 subforms per module. while we found a workaround on this occasion, only 2 subforms can be quite limiting in an enterprise setting. @Ishwarya SG I've read about imminent increase of other components (e.
        • Version of Cliq included with Zoho One and Limitations

          I'm confused by the information presented in the application detail page of Zoho One. I'm a solopreneur with a single-seat Zoho One Enterprise license and I need to communicate externally .. extensively. The plan details page suggests channels are limited to 100 members. Whereas the pricing plan comparison page on the Cliq marketing site says 2500 for enterprise level.  If it's 100... that's going to kill my use case as it is my understanding that external customers can only be communicated with
        • Resubmit for Approval for Zoho Books Module in CRM

          The integration between CRM and Books is great, but it is incomplete in many areas. One of them is if an estimate/invoice/sales order is rejected, the users in CRM cannot resubmit it for approval. Let's face it, sales people will mostly be in CRM and
        • How to get a list of selected records into a button-function? Here is how!

          So, you might know already how to get a button on a page somewhere and perform actions with a function when pressed, but how about a button that only works with the records you selected in the list view? The button selected is a custom button in the modules
        • Upload edited meeting recording for attendees to download

          Hi Would it be possible to let meeting organisers upload an edited version of the meeting recording? Usage case: most of us probably start a meeting 15 minutes before the official start time. It would be nice to trim that dead time off the recording.
        • Why does the embed feature within the article editor seem to be not functional?

          I would like to embed media into an article, but that feature seems to be non-functioning. Am I doing something wrong? to clarify, I do not want to create an article by embedding. I want to embed media into an article I have created in a manual.
        • Get all fields using COQL

          Hi Is it possible to get all the fields of a record using COQL?. Something similar to select * from Accounts in SQL.
        • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

          Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
        • Inquiry Regarding Image Display Issue in Campaign Duplication

          We are currently using Zoho Campaigns for email distribution to our clients. I would like to inquire about an issue we encountered. When duplicating a previously created and sent campaign from the "All Campaigns" section, the images used in the header
        • Can it change the language ?

          Hello ! The question is in the title ;) 
        • Notes and Notebook integration

          Maybe I missed it, but is there a way to synch notes in the desktop with the notes in the Notebook app? I've been combing through the help topics and other forum entries and not finding anything. When I downloaded the android app I assumed there was integration with the desktop notes. Is that not the case? thanks.
        • Tags on notes aren't syncing correctly on Android

          I've created notes on the desktop version that have several tags assigned, but on both my Android devices those notes only have ONE of those tags instead of all of them, despite the actual content of the note being correctly synced, and I'm also starting
        • Text formatting does not work (Notebook Mac)

          The text formatting does not work at all. It seems, that the program loses the selection and therefore hitting bold, italic, etc. does not do anything.
        • For Each Loop only returns 1st result of List, not the whole list?

          I have a custom function that collects event data from Google calendar using invokeURL. I want to create meetings in CRM from this URL response. The invokeURL response contains over 100 records and works perfectly (code line 2). Then I'm using a For Each
        • Zoho Sheet-Pulling in Data

          I have a module where we track POs, Bills etc (its easier for us this way). In this PO Module, we have a task related to a Job/Deal and various fields for costs. A Supplier on a Job might have several POs in this module for the job. I want to generate
        • Subform Data in v2 REST API

          What is the mechanism for adding subform data in the Creator v2 REST APIs?  There is nothing documented in the Data APIs documentation (https://www.zoho.com/creator/help/api/v2/).   I was able to determine how to GET the subform data by adding it to the
        • How do I delete a test email address to which I am supposed to send a test email?

          How do I delete an email address added to a test email recipient that is no longer needed due to resignation or other reasons?
        • Bug - OTP (email) and No Duplicates

          Scenario: Form with an email field, Validation: "No Duplicates" (because I want to ensure 1 entry per email). Embedded form into website (JS option). Enabled email based OTP. 1st test (via my website) - entered my email address - sent OTP - entered pin,
        • How to autorespond for inactive users?

          Hi, we have a few inactive users that we would like to set up an autorespond to the sender telling that the email addresses are no longer active. How can we do that?
        • What is Attendee Status 0 and 1?

          Hi there, I recently stumbled upon the API to get the attendee list and in the return value, there is a parameter called "status", and 0 supposed to mean not_attending, and 1 means attending. I cannot find this representation anywhere in the attendee
        • Next Page