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
certi_vimalcerti_vimal 

SSN Format Validation

Hi,


I have a requirement on a SSN field :-


- Should include dashes

- Should not be less than or more than 10 digits


Please assist in creating a validation rule for same.

 


Thanks,


Vimal

certi_vimalcerti_vimal

Sorry, it should be 9 digits* with 2 dashes.

certi_vimalcerti_vimal

I am trying with this validation rule. Can anyone tell me where I am going wrong?

 

OR(AND(LEN (SSN_TIN__pc) <> 11, NOT(ISBLANK(SSN_TIN__pc))), NOT(REGEX(SSN_TIN__pc, "[0-9]{3}-[0-9]{2}-[0-9]{4}")))

 

 

Thanks,

 

Vimal

VJSFDCVJSFDC

Hope this one helps:

 

NOT(

OR(

LEN (Social_Security_Number__c) = 0,

REGEX( Social_Security_Number__c , "[0-9]{3}-[0-9]{2}-[0-9]{4}")

))

Sridhar BonagiriSridhar Bonagiri

Hi ,

 

Not(REGEX(Social_Security_Number__c , "[0-9]{3}-[0-9]{2}-[0-9]{4}" ))

 

I hope this will resolve your issue.

Matias CalvoMatias Calvo
I know this is an old conversation, but just in case someone is looking for an SSN number validation and get here.

We have a free application in the Appexchange that does US Social Security Number validation and much others (IBAN, VAT, BIC...), without any Apex code and is updated including the newly supported countries every release.

Check this out: https://goo.gl/HHZ4c3

I hope this helps you and give us feedback to improve it.