• MRivas
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies

Hi all, I have a Regex for a phone validation and I want the phone to be entered in the following formats: XXXXXXXXXX, XXX-XXX-XXXX, (XXX) XXX-XXXX, (XXX)XXX-XXXX. Currently this validation is allowing false positives to be saved. In example (414 903-0980 or 343_989_0989 or 898)7879898. I am not sure how to fix it. Here is what I am using. 

(REGEX(Phone, "\\D?(\\d{3})\\D?\\D?(\\d{3})\\D?(\\d{4})$"))

 

  • April 18, 2022
  • Like
  • 0

Hi all, 
I am trying to write a validation rule that works like this, If field A (picklist) is filled with any value then field B(picklist) has to be yes. 

For example: If (field A) current_grade__c  has a choise selected, High School, Middle, Elementry... then (field B) enrolled_in_school__c, Has to be "YES", it cannot be No, Unknown or left blank. 

  • April 12, 2022
  • Like
  • 0

Hi Can I have many phone fields in one validation rule? For example, phone, work, mobile and emergency contact. I am using this formula. So my question is can I add more fields to this formula and if so, HOW? I have tried different things and no luck. 


AND(
OR(
ISNEW(),
ISCHANGED(Phone)
),
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone, "\\D?(\\d{3})\\D?\\D?(\\d{3})\\D?(\\d{4})$"))
)

  • April 12, 2022
  • Like
  • 0

I currently have this formula (below) but it does not allows me to save a phone number with the parenthesis. I want to be able to save the phone with or without the parenthesis. I want the user to be able to save the number in any of these formats: XXXXXXXXXX or XXX-XXX-XXXX or (XXX) XXX-XXXX or (XXX)XXX-XXXX.  All four ways. Is this possible? Witht the formula below I can save the first 2 formats but not the last 2. Thanks

AND(
OR(
ISNEW(),
ISCHANGED(Phone)
),
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
)

  • April 11, 2022
  • Like
  • 0

Hi all, I have a Regex for a phone validation and I want the phone to be entered in the following formats: XXXXXXXXXX, XXX-XXX-XXXX, (XXX) XXX-XXXX, (XXX)XXX-XXXX. Currently this validation is allowing false positives to be saved. In example (414 903-0980 or 343_989_0989 or 898)7879898. I am not sure how to fix it. Here is what I am using. 

(REGEX(Phone, "\\D?(\\d{3})\\D?\\D?(\\d{3})\\D?(\\d{4})$"))

 

  • April 18, 2022
  • Like
  • 0

Hi all, 
I am trying to write a validation rule that works like this, If field A (picklist) is filled with any value then field B(picklist) has to be yes. 

For example: If (field A) current_grade__c  has a choise selected, High School, Middle, Elementry... then (field B) enrolled_in_school__c, Has to be "YES", it cannot be No, Unknown or left blank. 

  • April 12, 2022
  • Like
  • 0

Hi Can I have many phone fields in one validation rule? For example, phone, work, mobile and emergency contact. I am using this formula. So my question is can I add more fields to this formula and if so, HOW? I have tried different things and no luck. 


AND(
OR(
ISNEW(),
ISCHANGED(Phone)
),
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone, "\\D?(\\d{3})\\D?\\D?(\\d{3})\\D?(\\d{4})$"))
)

  • April 12, 2022
  • Like
  • 0

I currently have this formula (below) but it does not allows me to save a phone number with the parenthesis. I want to be able to save the phone with or without the parenthesis. I want the user to be able to save the number in any of these formats: XXXXXXXXXX or XXX-XXX-XXXX or (XXX) XXX-XXXX or (XXX)XXX-XXXX.  All four ways. Is this possible? Witht the formula below I can save the first 2 formats but not the last 2. Thanks

AND(
OR(
ISNEW(),
ISCHANGED(Phone)
),
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
)

  • April 11, 2022
  • Like
  • 0