Update all member accounts simultaneously when the parent account is updated.
It isn't strange to have multiple branches in a business. Or having contacts with multiple branches of the same company. Either way, it would be better to have multiple member accounts for easier identification rather than have all contacts under a single account and lose track of who to contact in which branch. Zoho CRM facilitates the creation of multiple branch accounts (named 'member accounts') which are linked to a parent account.
As useful as this is, if there are any changes made to a parent account. Say, for instance, change of websites, social media pages, activities, deals, etc, then there lies the task of updating each member account manually once again. The process is repetitive. To spare you the effort of manual work, this custom function automates the process by updating the member accounts simultaneously when the parent account is updated.
Getting started with the function:
- Go to Setup > Automations > Actions > Functions > Configure Function > Write your own.
- Provide a name for the function. For example: "Update Deal Progression".
- Select the moduleto be associated as Deals. Add a description(optional).
- Copy the code given below.
- Click "Edit arguments".
- Enter the name as "parentaccId" and select the value as "Account Id".
- Enter the name as "parentownerId" and select the value as "Account Owner ID".
- Click Save & Execute Script.
- Save the changes.
- Use the custom function in conjunction with a Workflow rule to enable auto-update of member accounts.
For v2 Editor - DRE:
relatedaccount = zoho.crm.getRelatedRecords("Child_Accounts", "Accounts", parentacctId.toLong());
for each ele in relatedaccount
update = zoho.crm.update("Accounts", ele.get("id").toLong(), mp);
- The above code works only for API V2.0 and not the previous version.
Found this useful? Try it out and let us know how it works! If you have questions, do not hesitate to ask! Share this with your team if you find it useful!