You need to sign in to do that
Don't have an account?
Validation Rule to Check for Multiple, Repeating Text strings
I have a custom textarea field where a user could input multiple email addresses that are then pulled into an email template via a button that refers to this field.
What I am attempting to do is fire a validation rule if more than one '@' symbol is found and no comma (',') is present. The idea being that if the user wants to insert multiple email addresses then it'll prompt them to ensure these are separated via comma. The reason for doing this vs. creating mutliple lookup or email fields is that there may be instances where a user wants to include multiple (5+ recipents) and I do not want to waste fields or space on the page layout for all these individual fields and would rather just have one section.
Even better would be a rule that would look for & count how many '@' symbols appear and then make sure there are the same number of corresponding commas (well, actually one less since you do not need a comma at the end.)
The validation rule would then state something along the lines of "Please separate multiple email addresses with a comma."
I appreciate in advance any help that anyone can provide!
What I am attempting to do is fire a validation rule if more than one '@' symbol is found and no comma (',') is present. The idea being that if the user wants to insert multiple email addresses then it'll prompt them to ensure these are separated via comma. The reason for doing this vs. creating mutliple lookup or email fields is that there may be instances where a user wants to include multiple (5+ recipents) and I do not want to waste fields or space on the page layout for all these individual fields and would rather just have one section.
Even better would be a rule that would look for & count how many '@' symbols appear and then make sure there are the same number of corresponding commas (well, actually one less since you do not need a comma at the end.)
The validation rule would then state something along the lines of "Please separate multiple email addresses with a comma."
I appreciate in advance any help that anyone can provide!
If(Text_Area__c.countMatches('@')-Text_Area__c.countMatches(',')!=1, then add error.