Print this page

How to transfer Contact's Mailing Address to the account record?

Knowledge Article Number 000176111
Description Some customers would like to display the Contact's mailing address on the account record

In Salesforce, an Account can have several Contacts but Contacts cannot have several accounts by default. Since that is the case, the system would NOT know which contact needs to be the basis of where to get the address from.

For example, Account A has several contacts like Contact B, Contact C and Contact D. Now, if these contacts have different addresses, which of these contacts is the basis for the Address showing on the Account Record?
Resolution The best way to do this is to create a Contact Lookup field on the account level. From this action, we can determine the Primary Contact of the account and we will be able to get the address from this contact through cross-object formula field. Please note that formula fields are read-only fields and will not be able to be displayed on the EDIT MODE. But the values on this field will be visible on the record itself. Also, since the values on this field are dependent from other field values, whatever changes are made on the origin will automatically update whatever values indicated on the formula field.

To create a custom Contact Lookup field on accounts, please follow the steps below:
Click path: Name | Setup | Customize | Accounts | Fields.
1. Click New on Account Custom Fields & Relationships section.
2. Select Lookup Relationship as the data type then hit on next.
3. Select Contact on the "Related To" drop-down menu. Then hit next.
4. Field Label is the name that will be displayed on the layout; you can change that to Primary Contact.
5. Field Name is an internal reference. By default, the Name will just be the same as the Label.
6. Hit next.
7. Make sure this is available on your layout.
8. Hit Save.

Once this is done, create a formula field that will copy the address of the contact to your account. Name it as Contact Address, or whatever you want to call it.

Here are the steps:
Click path: Name | Setup | Customize | Accounts | Fields.
1. Click New on Account Custom Fields & Relationships section.
2. Choose Formula as the data type and hit next.
3. Enter a Field Label (e.g. Contact's Address), then choose Text as the Formula Return Type. Hit Next.
4. Then you will need to use this formula (Using the "Advanced Formula Editor"):

Contact__r.MailingStreet &BR()&
Contact__r.MailingCity & ", " &
Contact__r.MailingState & " " &
Contact__r.MailingPostalCode & BR() &

Note that the street, city, state, postal code and country are developer fields, to get these fields you need to click on Insert Field button. Then follow this path:

For Street, Account > Contact(or the name of the lookup field you created) > Mailing Street > Insert.

5. Click Next if you have received no errors
6. Make sure to have this field visible on the layout.
7. Hit Save.

Then you can customize your Account Layout to place the field to where you want it to be. Just go to Name | Setup | Customize | Accounts | Page Layouts | Edit.

promote demote