I'm looking to iterate through all of my deals and change a field in each given deal.
In my code below, I'm trying to record the last note's content and time in custom fields in CRM.
for each deal in all_deals
{
ID = deal.get("id");
info ID;
RelatedNotes = zoho.crm.getRelatedRecords("Notes", "Deals",ID);
//info RelatedNotes;
value = RelatedNotes.get(0).get("Note_Content");
time = RelatedNotes.get(0).get("Created_Time");
info value;
info time;
mp=map();
mp.put("Last_Note",value);
mp.put("Time_Note_Created",time);
update = zoho.crm.updateRecord("Deals",ID,mp);
info mp;
info update;
}