You need to sign in to do that
Don't have an account?
vicky30
validaition to allow only numbers & Hyphen(-)
Hi Firiends,
The below validation rule is not working, please help me on this
NOT($Profile.Name ='System Administrator'),ISPICKVAL(country, 'Brazil'),
OR(
NOT(
ISNUMBER( Zipcode__c)), LEN(Zipcode__c)<8,REGEX( Zipcode__c, "^(?!.*/)[a-zA-Z'*,/\r\n]+$")
)
)
The Zipcode should allow only numbers & one special character Hyphen(-)
Please anyone help me on this issue.
The below validation rule is not working, please help me on this
NOT($Profile.Name ='System Administrator'),ISPICKVAL(country, 'Brazil'),
OR(
NOT(
ISNUMBER( Zipcode__c)), LEN(Zipcode__c)<8,REGEX( Zipcode__c, "^(?!.*/)[a-zA-Z'*,/\r\n]+$")
)
)
The Zipcode should allow only numbers & one special character Hyphen(-)
Please anyone help me on this issue.
Greetings to you!
Please try the below:-
AND(
NOT(ISBLANK(Phone)),
NOT(REGEX(Phone, "[0-9()-]+"))
)
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
Please use REGEX(Zipcode__c, "[0-9-]+") in your formula to accept only numbers and character "hypen". Modify your other functions like LEN and ISNUMBER accordingly.
Hope this helps !
Thanks,
Sarvani
I tried both Regex, But its not working.
AND(NOT($Profile.Name ='System Administrator'),ISPICKVAL(Country__c, 'Brazil'),
OR(
NOT(
ISBLANK( Zipcode__c)), LEN(Zipcode__c)<8,NOT(REGEX( Zipcode__c, "[0-9-]+"))
)
)
You need to modify your formula as per your requirement. Having NOT(REGEX(Zipcode__c,"[0-9-]+")) alone in your fomula field as shown in below scrrenshot will only allow numbers in combination with hyphens. As you have other functions, please make sure they are working.
Hope this helps !
Thanks,
Sarvani