Blog

How to: Automatically Populate the Primary County Field based on the entered ZIP Code

Note: Functionality for populating regional data based on a country entry is only available for AddressTools Premium, if you are using AddressTools Free then you can trial our AddressTools Premium application to take advantage of this feature plus many more that it includes. This guide only applies to United States of America based addresses.

What Does This Guide Achieve?

After following this guide, you will have successfully configured a field that automatically populates with the appropriate Primary County corresponding to the ZIP code entered. This example will use the Account object.

Creating the Necessary Lookup Fields

To begin, you will need to create the three necessary lookup fields:

  • Country Lookup
  • State Lookup
  • ZIP Code Lookup

To achieve this, follow this guide, ensure that you use the address block which you intend to implement this functionality on.

After creating these fields, you will need to enable the lookup field population:

  • Go to App Launcher | AddressTools Administration.
  • Select Settings from the sidebar.
  • Click the pencil next to Enable Field Lookup Population.
  • Tick the Enable Field Lookup Population checkbox.
  • Click Save.

Adding the lookup fields to the Address Block

  • Navigate to AddressTools Administration Page | Address Blocks
  • Select the Down arrow next to the relevant address blocks and click Edit
  • Under the Lookup Fields section, select the fields that you just created and click Save

Creating a Formula Field to Display the County

  • Navigate to Setup | Object Manager | [Object you are using]
  • Select Fields & Relationships | New
  • Select Formula and then Next
  • Name the field and choose the Return Type as Text then click Next
  • Select Advanced Formula then Insert Field
  • Select [Object you are using][ZipCode Lookup field that you created in the previous step]Primary County

Note: You will need to configure the Field-Level Security for this field and add it to your Page Layout to meet your desired criteria.

Now with the formula field created and on the page layout, when the record is saved with a valid USA based ZIP Code value, the value from the associated county record will now appear in the lookup field.

Contact Us

If you have any questions in relation to this article, contact us at: support@provenworks.com We will be happy to answer any questions or problems that you may have.

Leave a Reply

 

Discover more from ProvenWorks

Subscribe now to keep reading and get access to the full archive.

Continue reading