You need to sign in to do that
Don't have an account?

Assigning a field a value based on Zip Code?
Hello,
I am trying to set up a trigger to update fields on a Lead object when said Lead is created.
What I'd like to do is set it up so that it assigns the Lead a Centile number based on the Zip Code.
I have an excel file mapping 30,000+ zip codes to these Centiles.
I cannot create a trigger that just says "If zip code is this, centile is this..." 30,000+ times because that will quickly reach the 100,000 character limit.
How would it be recommended that I complete this task?
Thank you,
I am trying to set up a trigger to update fields on a Lead object when said Lead is created.
What I'd like to do is set it up so that it assigns the Lead a Centile number based on the Zip Code.
I have an excel file mapping 30,000+ zip codes to these Centiles.
I cannot create a trigger that just says "If zip code is this, centile is this..." 30,000+ times because that will quickly reach the 100,000 character limit.
How would it be recommended that I complete this task?
Thank you,
The best way to approach this is to create a "Zip Code" custom object with a zip code field and a Centile number field, and insert your 30000+ zip codes as records. Once this is done, you can write a trigger on lead to query the zip code object for the centile number and update the lead.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.
Thanks,
Shashank