Skip to main content

Hey gang, I have combed these forums and worked the google machine without any success to find the syntax for a validation rule I need. We have a field that must be exactly six digits and numbers only, otherwise it breaks one of our integrations. No letters, commas, special characters allowed. As such, a simple number field won't work as that will default to using commas and in yet another SF headsmacking moment, apparently we are not allowed to customize the formatting of a number field.

It has been explained to me that ISNUMBER won't work as it will allow certain types of number formatting that we don't want. So, this is the relevant segment of the val rule that I have. It prevents me from entering characters but also fires if I enter a 6 digit number.

Can anyone help? Thanks in advance for your time.

NOT( REGEX( Custom_Field__c , '[^0123456789]' ) ),

 

LEN( Custom_Field__c ) <> 6 )

3 respostas
  1. 21 de jul. de 2020, 19:14
    OK.. preliminary testing looks good! Thanks a ton. Can you explain how that works?
0/9000