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

HOW TO VALIDATE PHONE DATATYPE FIELD WITH VALIDATION RULE
hi i want to validate a phone number field of phone datatype. now my rule is phone number must be a 10 digit number and it should not be a blank one .....now i used formula NOT(LEN(PHONENUMBER_C)=10).NO THERE IS NO SYNTAX ERROR AND SAVED THE RULE .WHEN I ENTERING IN PHONENUMBER FILED LIKE 9966055438 IT IS A TEN DIGIT NUMBER SO MY RECORD WILL HAVE TO SAVE .BUT AN ERROR WILL COME WHILE SAVING IT AND THAT PHONENUMBER IN DAT FIELD SHOWS LIKE DIS (996) 6055-438.IT IS NOT SAVING WHY THIS HAPPENING ? CAN ANY ONE TELL ME THE REASON
It is not saving because
1) you use a LEN to calculate the length
2) you use a data type as Phone which add the extension automatically
So in your case it is giving error because LEN calculate the complete input including spaces which is
(996) 6055-438. For this input, length is 14. So if you want to use the validation and phone datatype, then there two ways to make it work -
1) Instead of 10 use 14 like NOT(LEN(PHONENUMBER_C)=14)
2) Use REGEX
Regards,
Santosh Chitalkar
All Answers
Data type of your phone number field is Phone hence it is getting display like (996) 6055-438. Instad of phone change the data type as number.while changing datatype to number check the checkbox for Always require a value in this field in order to save a record(Required) so that it ll never b blank. write the same validation for this field.
Thanx and Regards,
Mrunali Gaonkar
It is not saving because
1) you use a LEN to calculate the length
2) you use a data type as Phone which add the extension automatically
So in your case it is giving error because LEN calculate the complete input including spaces which is
(996) 6055-438. For this input, length is 14. So if you want to use the validation and phone datatype, then there two ways to make it work -
1) Instead of 10 use 14 like NOT(LEN(PHONENUMBER_C)=14)
2) Use REGEX
Regards,
Santosh Chitalkar