function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Janine Du ToitJanine Du Toit 

Create a custom object with the zipcode data, and use a trigger on entry of addresses that sets county.

Hi There,

I am trying to create a custome object to trigger a county name on entry of an address in Salesforce. I have the steps to do it but I need clear instructions on how to do it. Below is the steps. If someone could please let me know how to do this, it would be great.

1. Create an object that contains the data of the zip codes. (How and where do I create this and how do we connect the zip codes to the county? We are working with 50 county's and around 2400 zip codes that need to be connected)
2. Create a trigger for contact created or edited, and one for account as well.
3. Use the zip code to look up the county in the custom object, and fill in the field on the contact or account record.

Thanks in advance,
Janine
ltlmschrisssltlmschrisss
Good Morning,

I would recommend working with a Salesforce Administrator to set this up. If you are trying to learn to be an admin then have them walk you through it. ​
1. ​Standardize your data
  • Is it going to be PG County, Prince Georges County, Prince George's County, PG, Prince Georges, Prince George's, PG - MD, Prince Georges, MD ect. decide now and document it in your field description​
  • You will also want to make sure that any future lists that you use to update the data follow this decision
  • Also, in your question you mentioned 50 counties and 2400 zip codes. You may want to consider getting a full list online. That way if you expand your business into other areas you will not have to worry about having missing data
  • Will you have separate county fields for the Billing/Shipping addresses?
 
2. Creating the custom object
​3. Import your data ​4. Build a autolaunched flow that will lookup the zip code and then update the account or contact
4. Use the process builder to trigger the flow ​Hope that helps some
Have a great day!​
 
Chandra Sekhar CH N VChandra Sekhar CH N V
Hey Janine,

Just curious to know about your requirement as why you need to populate country  and other fields based on records. We do have a standard country & state picklst feature in salesforce which enables you to configure your own countries & states which can be added to account/contact records.

Please correct if my understanding is incorrect here.
Janine Du ToitJanine Du Toit
Hi Chandra,

I am not trying to populate "country", I am trying to populate the "County" Field.

Thanks,
Janine
Janine Du ToitJanine Du Toit
Hi Chris,

I have created the custom object as well as the county name and zip code field but I have not added any zip codes or counties because the instruction are unclear. I have a questions:
How do I connect multiple zip fields to one county? Do I need to create 50 different fields with lookups or how do they actually connect to that specific county?The information provided does not explain multiple fields. If someone could please give me exact steps to follow after the custom object is created, it would really be helpful.

Thanks,
Janine
ltlmschrisssltlmschrisss
Good Afternoon,

Janine, shoot me an email and we can do a zoom meeting if you want some additional help. cking@autotraining.net

Thanks!

Christina​​
Lindsay JonesLindsay Jones
Hello @ltlmschrisss and @Janine Du Toit,

I just found this message chain. I am trying to do the exact same thing! Is there anyway you could provide a bit of additional detail on the "4. Build a autolaunched flow that will lookup the zip code and then update the account or contact" step? I am good on the other steps, but this one is tripping me up! Thanks for any help you can provide.

Lindsay
Aaron Persich 15Aaron Persich 15
I too am trying to create the same flow.  Any help is much appreciated. 
Cheryl Fernandes BNCheryl Fernandes BN
We have built a free app that updates the County based on the value of the zip code on the Lead (it also includes a solution for Accounts and Contacts). Here is a link to the blog article that describes the steps on how to configure the app and also contains a link to the package to install in your sandbox: https://bluninjas.com/update-county-based-on-postal-code/