I wanted to write a post on email validation after numerous searches and some tinkering with validation rules with custom patterns.
So here goes my very first forum post.
Issue: I need an email validation field that will only allow specific email domains from within my organization.
Test case: email domain = [email protected], [email protected], [email protected], [email protected]
FieldName = email
1. Create a text field
2. Mark as "Cannot be blank"
3. Create validation rule
4. Set Conditions
You will need 4 conditions.
Run rule when this condition is true
"email" "does not match pattern" "Custom pattern .+@+.[A-Za-z].mail.com" and
"email" "does not match pattern" "Custom pattern [email protected] " and
"email" "does not match pattern" "Custom pattern .+@.+.[A-Za-z].mail.com " or
"email" "does not match pattern" "Custom pattern .+@.+\..+ "
Select show screen tip and dialog box message
Set an informative Screen Tip and examples in your Dialog box.
This solution will allow for multiple domain levels below a single domain of "mail.com"