I love my day job
Practical Tweaks: creating a Social Security Number column - SharePoint Skater

SharePoint Skater

Custom control and client script aficionado, neck-deep in a simmering SharePoint stew.

Practical Tweaks: creating a Social Security Number column

Many people find SharePoint to be somewhat limiting in its out-of-the-box functionality, but really, a creative approach can take you pretty far.  Say, for example, you need to create a column to hold Social Security numbers (assuming you've worked out all the relevant security issues).  You have a field that requires numeric validation, but it has a specific length requirement, which sounds more like string validation.  Here's what I came up with off the cuff:

  1. Create a new Site Column.  Add it to whatever group makes sense (I picked Core Contact and Calendar Columns).
  2. Give it a name and a datatype of Number.
  3. Specify a maximum of 999999999 to take care of the ten-digit formatting issue.
  4. Explicitly set Number of decimal places to zero.
  5. Click OK.

 That's it.  Next time we'll look at masking/validating your user's input for this field.

Comments

Ryan M said:

SSNs can start with zero and be perfectly valid. It can even start with 00, just not 000.

"The first three (3) digits of a person's social security number are determined by the ZIP Code of the mailing address shown on the application for a social security number..."

- www.socialsecurity.gov/.../stateweb.htm

If a person's application contained a mailing address from New Hampshire, Maine, Vermont, Massachusetts, Rhode Island, Connecticut or New York they may receive a ssn that begins with zero.

# October 20, 2009 12:54 AM

PeterBrunone said:

Ryan, thanks for clearing that up.  I feel like an idiot, but only partially since I was born in 07054 but with a "1__" number.  Still, reference checks would help.

The error has been corrected and I will address further validation in a follow-up post.

# October 20, 2009 2:24 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)