Hello,
I am trying to update Tasks in Zoho CRM to make them recurring yearly, but I cannot find the correct recurrence pattern or way to update the Recurring_Activity field via API or Deluge.
I have tried:
Sending a string like "RRULE:FREQ=YEARLY;INTERVAL=1"
Sending an object like { "RRULE": "FREQ=YEARLY;INTERVAL=1" }
Adding additional parameters like DTSTART or UNTIL
All attempts return the error:
{
code: "INVALID_DATA",
details: {
expected_data_type: "RRULE",
api_name: "Recurring_Activity",
json_path: "$.data[0].Recurring_Activity.RRULE"
},
message: "invalid recurrence pattern",
status: "error"
I want the task to repeat every year on the same day as the Due_Date and never end.
I suspect the issue is either the format of the RRULE string or the way Recurring_Activity must be updated via API, but I cannot find any working example in the documentation.
Can someone provide a working RRULE format for a yearly task recurrence and show how to update it via API or Deluge?
My code example:
void automation.MassUpdateTasks()
{
tasks = zoho.crm.getRecords("Tasks", 1, 2000);
for each t in tasks
{
taskId = t.get("id");
dueDate = t.get("Due_Date"); // es. "2035-01-01"
d = dueDate.toDate("yyyy-MM-dd");
month = d.getMonth(); // 1..12
day = d.getDay(); // 1..31
rruleString = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + month + ";BYMONTHDAY=" + day;
updateMap = map();
updateMap.put("Recurring_Activity", rruleString);
resp = zoho.crm.updateRecord("Tasks", taskId.toLong(), updateMap);
info resp;
}
}
Tried also
rruleString = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + month + ";BYMONTHDAY=" + day + ";DTSTART=" + startDate + ";UNTIL=-1";
Thank you in advance!