You need to sign in to do that
Don't have an account?
Dea Simon
Zipcode lookup provides County detail
Hey all - I am an admin new to learning code and need a little help. I have a custom object called Counties. In this custom object are records that contain every zipcode, city, county, and state in the U.S..
I also have a "County" field on my contact object.
I would like to auto update the County field on my contact object automatically based on its zipcode. I want to accomplish this by having the contact zipcode lookup the matching zipcode in the counties object and then return the actual County value onto the contact object.
Make sense?
I'm pretty sure I need an apex trigger for this but I haven't learned how to make these yet - can anyone give me some help? Here are some screen shots of both my contact object and my counties custom object:
I also have a "County" field on my contact object.
I would like to auto update the County field on my contact object automatically based on its zipcode. I want to accomplish this by having the contact zipcode lookup the matching zipcode in the counties object and then return the actual County value onto the contact object.
Make sense?
I'm pretty sure I need an apex trigger for this but I haven't learned how to make these yet - can anyone give me some help? Here are some screen shots of both my contact object and my counties custom object:
You should be using a Map where Zipcode is Key and County is value so based upon Contact Zipcode.
You should then pull up the county from County object and populate on Contact object.
Do something like below :-
If this helps,please mark it as best answer to help others :)