I have a scheduled custom function that gets records from a custom view. I have an iteration that loops every 200 records. However, that iteration doesn't seem to work. When the schedule runs, it only updates 200 records. Does iteration/loop works for custom views?
iter = {0,1,2,3,4};
for each iteration in iter
{
fromindex = iteration * 200 + 1;
toindex = iteration * 200 + 200;
resp = zoho.crm.getRecords("Transactions",fromindex,toindex,{"cvid":3983363000033221676});
for each ele in resp
{
transid = ele.get("id");
prodid = ele.get("Product_Name").get("id");
rec_prod = zoho.crm.getRecordById("Products",prodid);
usageunit = rec_prod.get("Usage_Unit");
mp = Map();
mp.put("Usage_Unit",usageunit);
update = zoho.crm.updateRecord("Transactions",transid,mp);
}
}
info transid;
info mp;
Can you guys point out why it's not looping and using iteration? Thanks in advance for your assistance