Thursday, May 02, 2013

Some Usefull Lead Validation Rules

In a recent customer event, we discussed some useful validation rules for Leads. Many of the sample validation rules in the Help&Training application focus on Accounts and Contacts, however very few are specific to Leads. Fortunately, these can be easily "translated".

Requiring a 2 Digit country code (ISO 3166)


Requiring Zip+4 Postal Codes for US Leads

AND( OR( Country = "USA", Country = "US"), NOT(REGEX( PostalCode , "\\d{5}(-\\d{4})?")) )
Note: More details on Regular Expressions REGEX can be found in the J2SE documentation, basically \\d{5} indicates 5 digits, whereas \\D{5} indicates 5 non-digits.

Requiring 10-Digit US Phone Number for US Leads

AND( OR( Country = "USA", Country = "US"), NOT(REGEX( Phone , "\\D*?(\\d\\D*?){10}")) )

Simple example for requiring a positive number in a custom Monthly Budget field

Monthly_Budget__c < 0

No comments:

Post a Comment

Step-by-Step on How to Update Git on Mac

Good article on updating Git on your Mac, leveraging Brew. update-git/ Check current ...