Skip to content

Create Custom Address Fields

Overview

An address block needs five fields to describe an address: street, city, state, country and postal code. On Account, Contact, Contract and Lead these already exist as standard Salesforce fields, so there is nothing to create. On a custom object, or where you want a second address on a standard object, you create them yourself.

AddressTools expects each of the five to use a particular data type. Read this page even if the fields already exist, so you can check the types are right before you bind the block.

You can either create five individual fields, or use the single Salesforce Address compound field. We recommend separate fields as Salesforce's Address field type restricts the country and state values to its own picklists, which affects some AddressTools features.

Note: You can only use the singular Salesforce Address field if you have turned on the User Interface setting Use custom address fields in your org.

The Fields to Create

Field Label Data Type Length
Street Text Area 255
City Text 255
State Text 255
Country Text 255
Postal Code Text 255

Street uses Text Area rather than Text so that an address can run to more than one line. The other four hold a single value each.

Step 1: Create Each Field

Repeat these steps five times, once per row of the table above.

  1. Navigate to Setup > Object Manager.
  2. Select the object, then select Fields & Relationships.
  3. Click New.
  4. Choose the data type for the field you are creating and click Next.
  5. Enter the Field Label.
  6. Set Length to 255.
  7. Click Next.
  8. Provide visibility to all the users who will be verifying addresses, then click Next.
  9. Add the field to the page layouts where the address should appear, then click Save.

Note: Name the fields after the address they belong to if the object holds more than one, for example Site Street and Site City. It keeps the picklists readable when you come to map the block.

Step 2: Bind Them to an Address Block

The five fields above are all AddressTools needs to validate and standardise an address. For instructions on how to map them in the Postal Address Fields section of an address block, see Binding an Address Block.