Skip to content
zsetup
Blog · Fill a new Contact's phone from its Account in Zoho CRM

Fill a new Contact's phone from its Account in Zoho CRM

Zoho CRM copies an Account's address to new Contacts, but not its phone or fax. A small workflow and Deluge function fill the gap.

When you create a Contact from an Account in Zoho CRM, the Contact's mailing and other addresses are filled from the Account's billing and shipping addresses. Phone and fax are not. If your team keeps typing the company switchboard into every new Contact, a workflow rule can do it for them.

What you'll build

A workflow rule on Contacts that runs when a Contact is created. It calls a short Deluge function, which reads the Contact's Account and copies the Account's phone and fax into any of the Contact's fields that are still empty.

Step 1. Create the function

  1. Go to Setup → Developer Space → Functions and create a new function in the Automation category.
  2. Give it an argument named contactId of type int.
  3. Paste this body:
contact = zoho.crm.getRecordById("Contacts", contactId);
account = contact.get("Account_Name");
if(account != null)
{
	accountRecord = zoho.crm.getRecordById("Accounts", account.get("id"));
	update = Map();
	if(isBlank(contact.get("Phone")))
	{
		update.put("Phone", accountRecord.get("Phone"));
	}
	if(isBlank(contact.get("Fax")))
	{
		update.put("Fax", accountRecord.get("Fax"));
	}
	if(update.size() > 0)
	{
		zoho.crm.updateRecord("Contacts", contactId, update);
	}
}

The function only fills empty fields, so a direct number someone has already entered is never overwritten.

Step 2. Create the workflow rule

  1. Go to Setup → Automation → Workflow Rules and click Create Rule.
  2. Choose the Contacts module and name the rule, for example "Fill phone from Account".
  3. Run it on a record action, when a record is created.
  4. Apply it to all Contacts, or add a condition such as "Account Name is not empty".
  5. Under Instant Actions, choose Function, pick the function from Step 1 and map contactId to the Contact's Contact Id.
  6. Save the rule.

Step 3. Test it

Open an Account that has a phone number, create a new Contact from its Contacts related list, leave Phone empty and save. Refresh the Contact and the Account's phone should be there.

Going further

The same pattern works for any field Zoho doesn't copy for you: website, industry, or a custom field such as a customer tier. Add more if blocks, and consider a second rule on edit if Contacts are often moved between Accounts.

Want this set up, or something more involved? Talk to us.

Contact

hello@zsetup.com

Already a client? support@zsetup.com