Take a case of leads captured through web-forms. Most leads don't fill out the entire form. Once the lead is prospected, you go on to create relevant records in contact and accounts module. Now that you qualified the leads, you don't want to miss out on an opportunity to collect more details, do you? When you update these details in the accounts module, you'd want these to be automatically updated in the contacts module as well. This week's custom function helps in doing just that.
And it isn't just the Contacts module that gets updated. The related fields in any selected module, including custom modules, is auto-updated using this custom function. To apply this custom function to other modules, simply update the module names and ID in the code.
Getting started with the function:
The Code:
relatedcontacts = zoho.crm.getRelatedRecords("Contacts", ("Accounts"), accountId.toLong());
//info relatedcontacts;
for each ele in relatedcontacts
{
mp=map();
mp.put("Contact_Type", input.type );
update = zoho.crm.update("Contacts", ele.get("id"), mp);
info mp;
info update;
}