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
SFineSFine 

Dynamic Phone Validation

We're working on getting a phone validation that would recognize the difference between US Numbers and International Number AND checks that no alpha characters are being used.

 

We have it so that the US numbers work correctly, but not the international numbers. The closest we've come runs into a syntax error.

 

IF(
LEFT(Phone, 1) <> "+",
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}")),
NOT(REGEX(Phone, "\+[\d\-]+")
)

 

Any help would be appreciated.

VJSFDCVJSFDC

hi,

 

The expression to check whether its an Internaltion number LEFT(Phone, 1) <> "+" conflicts with  the Expression to check for US Number has ten digit.

 

Please check the Validation document which gives description about the Phone Number Has International Format and US Phone Number Has Ten Digits

 

 Phone Number Has International Format :"Validates that the Phone number begins with a plus sign (+) forcountry code. Note that this validation rule conflicts with the ten-digit rule."

 

Might be thats the reason you are getting error.