You need to sign in to do that
Don't have an account?

REGEX - Validation Rule
I'm trying to create a validation rule that will restrict the users from entering more than 20 characters or non-numeric characters..
Validation Error message: Please enter a numbers only and should not be more than 20 characters.
Below is a sample formula in my validation rule, however I couldn't seem to get it working correctly. Please help. Thanks
OR( LEN(input__c)>20, REGEX(input__c,"\\D*") )
Try this
OR (LEN(input__c)>20,
NOT(ISNUMBER(input__c))
)
All Answers
It should work , when you say it's not working are you able to save it even if the length is greater then 20 characters ?
The 20 character limitation is working.. however, I can still enter non-numeric.. For example, "12343ABC" it should not accept it because of the "ABC"
These are sample valid inputs:
122345
123423423
12345678901234567890
These are NOT valid inputs:
1232A
12F34
1234567890123456789011
Try this
OR (LEN(input__c)>20,
NOT(ISNUMBER(input__c))
)
Did it worked?
Yup it did. Awesome! Thanks man!