account = zoho.crm.getRecordById("Accounts",accountid);
//Get Company Overview Value
company_overview = account.get("Company_Overview");
//Get the related Deal IDs
deal = zoho.crm.getRelatedRecords("Deals","Accounts",accountid);
dealids = List();
for each d in deal
{
dealids.add(d.get("id"));
}
//Update Company Overview Value in the similar field in all related Deals
for each id in dealids
{
update = zoho.crm.updateRecord("Deals",id,{"Company_Overview":company_overview});
info update;
}
deal = zoho.crm.getRecordById("Deals",dealid);
//Get Company Overview Value
company_overview = deal.get("Company_Overview");
//Get the Account ID
accountid = deal.get("Account_Name").get("id");
//Update Company Overview value in the similar field in the Account
update = zoho.crm.updateRecord("Accounts",accountid,{"Company_Overview":company_overview});
//info update;
//Get other related Deal IDs of the Account
deals = zoho.crm.getRelatedRecords("Deals","Accounts",accountid);
dealids = List();
for each d in deals
{
dealids.add(d.get("id"));
}
//Update the Company Overview value in all other Deals related to the Account
for each id in dealids
{
if(id != dealid)
{
update2 = zoho.crm.updateRecord("Deals",id,{"Company_Overview":company_overview});
info update2;
}
}
Replace “Company_Overview” with the relevant field name.
Book a free 30-minutes consultation with a Zoho expert or send us an email