This is a great solution posted by Deepak Anand on the Salesforce.com Answers community today.
1. If you have 400 Invalid Domains and just few Valid ones then why not write a VR checking if they all have the Valid Ones or Not:
AND(
NOT(CONTAINS(Email, 'gmail.com')),
NOT(CONTAINS(Email, 'yahoo.com')),
NOT(CONTAINS(Email, 'outlook.com'))
)
2. This is where VLOOKUP plays the best role! You actually don't need any Apex to get this done. I will explain how to do it. You can create a Custom Object say 'Invalid Email Domains' with two fields say:
(i) Domain Name[Name Field(Default)]
(ii) Description[Text Area]
Say we have 'example.com' is an Invalid One or Not Allowed One. If so a record will be created like as below:
Domain Name - example.com
Description - Does not comply with PCI Rules.
So in short the Name field should contain the Domain Name and the Description should help for future use. If that is done, you can then populate the Custom Object(Invalid Email Domains) with the records via the Native Data Loader or Dataloader.io or whatever. So the best part of this is that it becomes very User friendly in that sense where you could just create a New Record to indicate a Invalid Email Domain or remove an existing record if at all any one becomes Valid.
Now, how will we go about with the VR. Here you go:
MID(Email, FIND('@', Email)+1, LEN(Email)) =
VLOOKUP(
$ObjectType.Invalid_Email_Domain__c.Fields.Name ,
$ObjectType.Invalid_Email_Domain__c.Fields.Name ,
MID(Email, FIND('@', Email)+1, LEN(Email))
)
MID(Email, FIND('@', Email)+1, LEN(Email)) extracts the portion just after '@' from an Email Field. For eg: if the email was john.dale@example.com the the result would be 'example.com'.
The VLOOKUP actually performs a scan on all the records belonging to the Custom Object - Invalid Email Domain(that we just created) and if any one record's Name field matches with the extracted text - 'example.com', then it returns the value contained in the Name field of that matched record and it will be equated with the extracted portion(MID(Email, FIND('@', Email)+1, LEN(Email))). If they are equal then it returns a 'TRUE' and the VR fires!
This is just yet another awesome feature of Force.com - VLOOKUP!
Thats it!. You are done!
1. If you have 400 Invalid Domains and just few Valid ones then why not write a VR checking if they all have the Valid Ones or Not:
AND(
NOT(CONTAINS(Email, 'gmail.com')),
NOT(CONTAINS(Email, 'yahoo.com')),
NOT(CONTAINS(Email, 'outlook.com'))
)
2. This is where VLOOKUP plays the best role! You actually don't need any Apex to get this done. I will explain how to do it. You can create a Custom Object say 'Invalid Email Domains' with two fields say:
(i) Domain Name[Name Field(Default)]
(ii) Description[Text Area]
Say we have 'example.com' is an Invalid One or Not Allowed One. If so a record will be created like as below:
Domain Name - example.com
Description - Does not comply with PCI Rules.
So in short the Name field should contain the Domain Name and the Description should help for future use. If that is done, you can then populate the Custom Object(Invalid Email Domains) with the records via the Native Data Loader or Dataloader.io or whatever. So the best part of this is that it becomes very User friendly in that sense where you could just create a New Record to indicate a Invalid Email Domain or remove an existing record if at all any one becomes Valid.
Now, how will we go about with the VR. Here you go:
MID(Email, FIND('@', Email)+1, LEN(Email)) =
VLOOKUP(
$ObjectType.Invalid_Email_Domain__c.Fields.Name ,
$ObjectType.Invalid_Email_Domain__c.Fields.Name ,
MID(Email, FIND('@', Email)+1, LEN(Email))
)
MID(Email, FIND('@', Email)+1, LEN(Email)) extracts the portion just after '@' from an Email Field. For eg: if the email was john.dale@example.com the the result would be 'example.com'.
The VLOOKUP actually performs a scan on all the records belonging to the Custom Object - Invalid Email Domain(that we just created) and if any one record's Name field matches with the extracted text - 'example.com', then it returns the value contained in the Name field of that matched record and it will be equated with the extracted portion(MID(Email, FIND('@', Email)+1, LEN(Email))). If they are equal then it returns a 'TRUE' and the VR fires!
This is just yet another awesome feature of Force.com - VLOOKUP!
Thats it!. You are done!
Nowadays, most of the businesses rely on cloud based CRM tool to power their business process. They want to access the business from anywhere and anytime. In such scenarios, salesforce CRM will ensure massive advantage to the business owners. Salesforce Course in Chennai|Salesforce Training Chennai
ReplyDeleteI ‘d mention that most of us visitors are endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.
ReplyDeleteselenium training in chennai
I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
ReplyDeleteselenium training in chennai
aws training in chennai
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteData Science training in marathahalli
Data Science training in btm
Data Science training in rajaji nagar
Data Science training in chennai
Data Science training in kalyan nagar
Data Science training in electronic city
Data Science training in USA
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeletepython online training
python training in OMR
python training institute in chennai
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteDevops Training in Chennai
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeleteBest Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies
Selenium Training in Bangalore | Best Selenium Training in Bangalore
AWS Training in Bangalore | Amazon Web Services Training in Bangalore
Thanks for sharing these effective tips. It was very helpful for me.
ReplyDeleteIELTS Coaching in Adyar
IELTS Class in Thiruvanmiyur
IELTS Class in Triplicane
IELTS Coaching in Anna Nagar
IELTS Coaching Centre in Koyambedu
IELTS Coaching Centres in Chennai Mogappair
IELTS Classes near me
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Have you been thinking about the power sources and the tiles whom use blocks I wanted to thank you for this great read!! I definitely enjoyed every little bit of it and I have you bookmarked to check out the new stuff you post
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
uipath online training
Python online training
such an great post and amazing tips about semrush because i like it and thank you. keep it up.
ReplyDeleteFor Premium Accounts at cheap rate check this site premium Accounts Seller
Netflix premium account -- Netflix premium Account
Premium Accounts at cheap -- Hotstar premium Account
Hotstar premium account -- Hotstar premium Account
Amazing post thanks for sharing.
ReplyDeleteSpark Training Institute in Bangalore
Apache Spark Training bangalore
Be a part of India's fast growing institution . As our institution is providing CS executive classes and free CSEET classes . So don't waste your valuable time and contact us or visit our website at https://uniqueacademyforcommerce.com/
ReplyDeleteI really enjoy reading your blog. this info will be helpful for me. Thanks for sharing.
ReplyDeleteJewellery ERP Software Dubai
Jewellery ERP Software Dubai