VLOOKUP - ZIP code (of an object) entered against a table(Zip Code object) - there's a match #inSalesforce

VLOOKUP -  ZIP code (of an object) entered against a table(Zip Code object) - check if there's a match

Suppose there is an object named ZipCode with fields ZipCode(Name) and State.

Now you want to validate Zip code in Account object with the codes in Zip Code object. If there is no match, validation error is shown.


Syntax -

VLOOKUP(field_to_return, field_on_lookup_object, lookup_value)


Solution: Create a Validation Rule on Account:

VLOOKUP($ObjectType.ZipCode__c.Fields.State__c, $ObjectType.ZipCode__c.Fields.Name , LEFT(BillingPostalCode ,5))<> BillingState


Visual: https://www.youtube.com/watch?v=0IVC05h2Eqw

Comments