I have a Workflow set up so that if ANY field is updated on an Account, the mapped fields on the Contacts associated with that Account will update. This so we can keep certain fields on both the Account record and Contact records synced. I'm using the Function below in this Workflow, but it seems to only be updating the fields on the first Contact listed with the Account. For each Account, all of the first Contact's mapped fields are updating, but any additional Contacts after the first are not updating the fields. I had this working in a different instance of Zoho CRM, but for some reason not working here. How do I fix this? Here is the function:
accountId = accId.toString();
rec = zoho.crm.getRecordById("Accounts",accId);
resp = zoho.crm.getRelatedRecords("Contacts","Accounts",accountId);
for each ele in resp
{
mp = Map:String();
mp.put("InsideGuide_Status1",rec.get("InsideGuide"));
mp.put("InsideGuide_Type",rec.get("InsideGuide_Account_Type"));
mp.put("Account_Number",rec.get("Account_Number"));
mp.put("Appscension_Status",rec.get("Elevate"));
mp.put("Tessitura_Integration_Status",rec.get("Elevate_with_Tessitura"));
mp.put("Prospect_2_Integration",rec.get("Prospect_2_Integration"));
contactId = ele.get("id");
updateResp = zoho.crm.updateRecord("Contacts",contactId,mp);
}