function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sudhirn@merunetworks.comsudhirn@merunetworks.com 

Formual field to check domain names contains in the list

Hi, 
 
 In account we need to add a validtion on email domain field which is in email format eg. sudhir@gmail.com

 Field name is Email_Domain__c

 if any of the mail contains “gmail.com”, “hotmail.com”, “yahoo.com”, “gmx.de”, “googledomain.com”, “mail.ru”, “web.de”, “live.com”, “aol.com”, “gmx.net”, “yandex.ru”, “me.com”, “msn.com”, “comcast.com”, “hushmail.com”, “yahoo.de”, “hotmail.co.uk”, “lavabit.com”, “sbcglobal.net”, “safe-mail.net”, “ymail.com”, “yahoo.co.uk”

It should through message saying personal email cannot be entered.

Thanks
Sudhir

Best Answer chosen by sudhirn@merunetworks.com
Deepak GulianDeepak Gulian
OR(
CONTAINS(Email_Domain__c,"gmail.com"),
CONTAINS(Email_Domain__c,"yahoo.com")
and so on.....
)

All Answers

BRTRAJBRTRAJ
write a simple trigger. throwing error with formula might not work here.
sudhirn@merunetworks.comsudhirn@merunetworks.com
I wrote a trigger which will update domain now with forumal i need to validate non of the below domain should contain in the field Email_Domain__c

if any of the mail contains “gmail.com”, “hotmail.com”, “yahoo.com”, “gmx.de”, “googledomain.com”, “mail.ru”, “web.de”, “live.com”, “aol.com”, “gmx.net”, “yandex.ru”, “me.com”, “msn.com”, “comcast.com”, “hushmail.com”, “yahoo.de”, “hotmail.co.uk”, “lavabit.com”, “sbcglobal.net”, “safe-mail.net”, “ymail.com”, “yahoo.co.uk”

Thanks
Sudhir
Deepak GulianDeepak Gulian
OR(
CONTAINS(Email_Domain__c,"gmail.com"),
CONTAINS(Email_Domain__c,"yahoo.com")
and so on.....
)
This was selected as the best answer
Nagendra ChinchinadaNagendra Chinchinada
OR( 
Right(Domain_Email__c , (LEN(Domain_Email__c)-FIND("@", Domain_Email__c ))) = "gmail.com",
Right(Domain_Email__c , (LEN(Domain_Email__c)-FIND("@", Domain_Email__c ))) = "hotmail.com",
Right(Domain_Email__c , (LEN(Domain_Email__c)-FIND("@", Domain_Email__c ))) = "yahoo.com",
Right(Domain_Email__c , (LEN(Domain_Email__c)-FIND("@", Domain_Email__c ))) = "gmx.de",
Right(Domain_Email__c , (LEN(Domain_Email__c)-FIND("@", Domain_Email__c ))) = "googledomain.com"
)
ajay rawat 14ajay rawat 14
Hi Sudhirn
             Try below formula in validation rule

CONTAINS('gmail.com:hotmail.com:yahoo.com:gmx.de:googledomain.com:mail.ru:web.de:live.com:aol.com:gmx.net:yandex.ru:me.com:msn.com:comcast.com:hushmail.com:yahoo.de:hotmail.co.uk:lavabit.com:sbcglobal.net:safe-mail.net:ymail.com:yahoo.co.uk',RIGHT(Email_Domain__c,LEN(Email_Domain__c) -FIND('@',Email_Domain__c)))

Thanks
Ajay Rawat
eswar janaeswar jana
Hotmail.com is the one of the predominant email portals that people have been using. There was a period went people went crazy using Hotmail addresses because of the advanced features they offered. However, the creation of new hotmail.com login (https://hotmail-loginx.com/hotmail-com-login-sign-up/) account has come to halt for certain reasons.