You can create multiple member accounts connected to a parent account in your CRM, ensuring you track who to contact in each branch. While this may be convenient, it's not unusual for companies to share a physical location and use a shared billing address. In this situation, you have to manually update each member account, which can be monotonous and consume your valuable time and energy. But now, there's a solution!
To spare you the effort of manual work, you can create a custom function that automatically updates the billing address of the member accounts simultaneously when their parent account is updated. To set things up, create the function and link it to the workflow rule for the Accounts module.
Permissions and availability
- Users with the Manage Automation permission can create and update workflow rules.
- Users with the Manage Extensibility permission can write custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Create a workflow rule for the Accounts module that will trigger a custom function whenever a parent account is created or edited. Learn more
- Write a custom Deluge function that copies the billing address of the parent account into its member accounts. Learn more
- Test the workflow rule in a sandbox before deploying it in your production environment. Learn more
Create a workflow rule
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select Accounts from the module dropdown list.
- Provide a name for the rule. For example: "Copy billing address".
- Add a description, if required, then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Create or Edit from the drop-down.
- Check the box for Repeat this workflow whenever an Account is edited.
- Click Next.
- In the Which accounts would you like to apply the rule to? section, select All Accounts and click Next.
- Under Instant Actions, select Function and Write your own.
- Provide a Name and description, if required, for the function.
- On the Deluge Script Editor, do the following:
- Copy and paste the code given below.
- Click Edit Arguments.
- Enter the name as parentId and select the value as Accounts - Parent Account.
- Click the + icon to add more arguments.
- Enter the name as accountId, select the value as Accounts - Account Id, then click Save.
- Click Save & Execute Script.
- Click Save on the workflow rule page.
The code
parentAccount = zoho.crm.getRecordById("Accounts",parentId);
//Map the billing address fields of the account
mp = Map();
mp.put("Billing_City",parentAccount.get("Billing_City"));
mp.put("Billing_Code",parentAccount.get("Billing_Code"));
mp.put("Billing_Country",parentAccount.get("Billing_Country"));
mp.put("Billing_State",parentAccount.get("Billing_State"));
mp.put("Billing_Street",parentAccount.get("Billing_Street"));
info "mp : " + mp;
update = zoho.crm.updateRecord("Accounts",accountId,mp);
info "update : " + update;
Notes
- Make sure to use the accurate API names for their corresponding fields in the code snippet. Learn more
- The above code is an example of copying the billing address of the parent account into its member accounts. By modifying the field name and parameters, you can copy other parent account information, such as websites, social media pages, activities, deals, and so on.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Click the Accounts tab.
- Open an account record that contains one or more member accounts associated with it (see: Related List - Member Accounts).
If necessary, create and associate a new member account. - Update the billing address fields and save the changes.
- Check whether the updated billing address information gets transferred to all of its member accounts.
Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.
More info
- ModuleAccounts
- Trigger PointWorkflow Rule
- EditionEnterprise and above
- ComplexityMedium
- Implementation Time30 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST