• Michael Sabel 9
  • NEWBIE
  • 40 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 9
    Replies
Here's the formula I am using for a Validation Rule to require a specific phone number format be entered (xxx) xxx-xxxx. This formula works for me.

AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)

Is there anything I can add to the formula to prevent it from firing on a specific record type? Let's call it "Record Type A".

Thanks.
So, I want to make sure that user can't type "St." for Street and must type "St" instead. And, that user can't type "Suite, 4" and must type "Suite 4".
So, no commas "," or periods ".". 

Here's what I've tried. Not working because I think what I've done here is allow for commas and periods when I'm trying to exclude them. Not sure how to exclude them.
AND(
NOT(ISBLANK(MailingStreet)),
NOT(REGEX( MailingStreet, "[a-zA-Z0-9\\.\\,]+"))
)

Thanks.
Hi, I'm using this validation rule to ensure users type in phone numbers in this format (xxx) xxx-xxxx:
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
 
I found this specific vr in Salesforce Help.
This is for Contacts.
Problem I'm having: The validation rule is firing even when the number is inputted in the right format. I tried it in production, developer account and sandbox and it is still doing the same thing.
Thanks.