+ Start a Discussion
vicky30vicky30 

validation rule for zipcode

Hi Friends,
Could anyone please help on this. I want to put validation rule for zipcode to prevent the special character. And this validation rule should work only for one country(market). I used the below logic but its not working.

IF( ISPICKVAL(ZTS_EU_Market__c, Brazil)NOT(REGEX( ZTS_EU_Zip_Postal_Code__c,"^[a-z  A-Z]*$")))
Please help me on this.
 
Best Answer chosen by vicky30
Ajay K DubediAjay K Dubedi
Hi vicky30,
The problem is with the IF syntax. It should contain a true and a false statement.
You can try the below formula using AND function:
AND(ISPICKVAL(ZTS_EU_Market__c, Brazil),NOT(REGEX( ZTS_EU_Zip_Postal_Code__c,"^[a-z A-Z]*$")))
Let me know if it works by marking it as best answer.

Thank you,
Ajay Dubedi

All Answers

Ajay K DubediAjay K Dubedi
Hi vicky30,
The problem is with the IF syntax. It should contain a true and a false statement.
You can try the below formula using AND function:
AND(ISPICKVAL(ZTS_EU_Market__c, Brazil),NOT(REGEX( ZTS_EU_Zip_Postal_Code__c,"^[a-z A-Z]*$")))
Let me know if it works by marking it as best answer.

Thank you,
Ajay Dubedi
This was selected as the best answer
vicky30vicky30
Hi Ajay,
Yes, you are right. Thanks for your help