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
KbhaskarKbhaskar 

validation rule ISNUMBER(number) accepting +

hi,
I am trying to add a new validation rule ISNUMBER(number) on a custom phone  field.
but it seems like its accepting  symbols like + at the first position
 ISNUMBER(Phone_c)
eg:-
ISNUMBER('12345') --> no error 
ISNUMBER('+1234')--->no error(this needs to be avoided )
------------------------------------------------------------------------------------------------------------------------------

IF( 
ISBLANK(Phone_c) , false , ISNUMBER(Phone_c))
Rupali PophaliyaRupali Pophaliya
Hi Bhaskar,

You don't need to perform this type of validation on a Number field. ISNUMBER function determines if a text value is a number and returns TRUE if it is.  Otherwise, it returns FALSE.
It will only accept a TEXT field as a parameter.

https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en#ISNUMBER

This type of validation is not required. Salesforce Number field will perform that validation internally. You do not need to do anything for that validation.
JyothsnaJyothsna (Salesforce Developers) 
Hi Bhaskar,

IsNumber():
 Determines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
Phone validation 
ISNUMBER(text) and replace text with the merge field name for the text field.​
OR(LEN(Bank_Account_Number__c) <> 10, NOT(ISNUMBER(Bank_Account_Number__c)))
This validation rule ensures a custom text field called Bank Account Number is a number of 10 digits and is not blank.

Hope this helps you!
Regards,
Jyothsna
SFSF
Hi @kbasker, were you able to find a solution, I am running into the same issue, I am unable to add any validation on a number field. ISNUMBER and Regex is not working.