Skip to main content
Hi Trailblazer Community,

 

Need a help to achieve below functionality. 

 

how to write a validation rule such that it should not allow any special characters(!@#$%^&*) and not allow all zeros in a field. (eg: 0 or 00 or 000 or 0000). 
2 Antworten
  1. 5. Okt. 2018, 11:01
    Hi Swetha,

     

    The above regex would not allow for any numbers whatsoever. Let's formulate a validation rule to block all 0s and special characters:

     

    OR (

     

        NOT REGEX(MyField__c,"^[a-zA-Z0-9]*$")),

     

        REGEX(MyField__c, "^0+$")

     

    )

     

    The following runs two checks. The first one checks that the value is alphanumeric, containing only letters and digits. The second verifies that the value is not entirely 0s.
0/9000