In CRM, account owners are fully aware of all aspects of their customers, such as their preferences, previous exchanges, and current requirements. When these individuals manage an account and any associated deals, it creates a consistent approach to customer interactions, ultimately enhancing the overall experience for both the customer and your business.
It's important to understand that account ownership can change for various reasons. In such cases, you must assign the new account owner to their corresponding deal records. While there is an option to transfer open deals to new owners through the user interface, this option does not extend to closed deals, requiring them to be updated individually, which can be time-consuming. This is where our low-code tools can come in handy.
To automatically update the deals with the new account owner, you can create a custom function and connect it to a workflow rule for the Accounts module. Once done, you can ensure that whenever you modify an account owner, all deals created for that account get effortlessly assigned to the new owner.
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 triggers upon modifying the account owner. Learn more
- Write a custom Deluge function that automatically assigns the new account owner as the deal owner. Learn more
- Test the workflow rule in a sandbox before deploying it in your production environment. Learn more
Create a workflow rule
Follow the steps below to create a workflow rule in your Zoho CRM account:
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select Accounts from the module dropdown list.
- Provide a name for the rule. For example: "Update account owner as deal owner".
- Add a description (optional), then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Edit from the dropdown.
- Choose Specific field(s) gets modified from the dropdown, then enter the condition "When <Account Owner> is modified to <any value>".
- 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 accid, select the value as Accounts - Account Id, then click Save.
- Click Save & Execute script.
- Click Save on the workflow rule page.
The code
acctDetails = zoho.crm.getRecordById("Accounts",accid);
related = zoho.crm.getRelatedRecords("Deals","Accounts",accid);
if(related.size() > 0)
{
datalist = List();
count = 0;
for each ele in related
{
mp = Map();
mp.put("Owner",acctDetails.get("Owner").get("id"));
mp.put("id",ele.get("id"));
datalist.add(mp);
count = count + 1;
}
if(count >= 100)
{
update = zoho.crm.bulkUpdate("Deals",datalist.subList(0,100),{"trigger":{"workflow"}});
info update;
update = zoho.crm.bulkUpdate("Deals",datalist.subList(100),{"trigger":{"workflow"}});
info update;
}
if(count < 100)
{
update = zoho.crm.bulkUpdate("Deals",datalist,{"trigger":{"workflow"}});
info 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 updating ownership of all deal records related to an account when their owner changes in your CRM. You can use this code for Quotes or any other custom module by modifying the module name and parameters.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to the Accounts module and select the account whose ownership you want to change.
- On the Account Details page, update the Account Owner to the appropriate user.
The workflow rule will be triggered. - Check whether all deals associated with the account reflect the new owner.
Idea
When you create a deal, the system assigns you as its owner until it is updated. However, you can automatically assign deals to their corresponding account owners, regardless of who created them, by setting up a workflow rule as described below:
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select Deals from the module dropdown list.
- Provide a name for the rule. For example: "Update deal owner as account owner".
- Add a description (optional), then click Next.
- In the Execute this workflow rule based on section, choose Record Action, select Create, and then click Next.
- In the Which deals would you like to apply the rule to? section, select All Deals, and click Next.
- Under Instant Actions, select Assign Owner.
- In the Assign Owner window, do the following:
- Select User Fields from the Category dropdown.
- Select Accounts and then Account Owner from the secondary dropdown.
- Click Save and Associate.
- Click Save on the workflow rule page.
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
- ComplexityLow
- Implementation Time15 minutes

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