+ Start a Discussion
Kishan Kumar 77Kishan Kumar 77 

I need to write a validation rule for a field that should only accept numbers and no other characters.

It should be of length 8 only. And it can accept only numbers no alphabet no special characters
SwethaSwetha (Salesforce Developers) 
HI Kishan,
You can try this
OR(
      NOT(ISNUMBER(Text__c )),

      AND(
         LEN(Text__c ) != 8
           )
   )

Related: https://salesforce.stackexchange.com/questions/255839/validation-rule-for-text-field-it-should-accept-only-numeric-value-and-accepts

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
sachinarorasfsachinarorasf
Hi Kishan,

Please apply the following validation for a field that should only accept numbers and no other characters :

NOT(ISNUMBER(fieldApiName)  &&  LEN(fieldApiName) <=  8)

I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com