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
saraAsaraA 

Print SSN with Dashes

Hi -

I have an SSN field - it's encrypted for most users and for most applications/profiles.


However, one application needs to see the SSN, so I gave them access to view encrypted fields.

 

Now, they want to view it formatted as SSN, and they want it printed, like on their insurance forms, formatted as SSN - with all the numbers and the dashes.


How can I do this?

 

Thank you in advance -

Sara

MrTheTylerMrTheTyler

Howdy Sara,

 

  I would suggest using a formula field that reads the SSN field value as a string and splits it up according to SSN standard (XXX-XX-XXXX).

 

 

Kind Regards,

 

Tyler Hudson
Contact Us - We Can Help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x123

saraAsaraA

I tried - I don't see SSN when I look for fields in "Formula".  What do I have to do?

 

Thanks -
sara

MrTheTylerMrTheTyler

First you will need to figure out the field name which holds the SSN.  You can do this by going to your page layout or your field definitions on the object.  Then, use that field name in your formula.

 

Kind Regards,

 

Tyler Hudson
Contact Us - We Can Help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x123

saraAsaraA

I tried that - it says I've referenced an unsupported field (Text Encrypted) and the field name:  SSN_c

 

I also couldn't figure out how to get the 2 middle characters - I could use LEFT and RIGHT but how do I get the middle 2?

MrTheTylerMrTheTyler

Never dealt with encrypted fields before so I figured I'd give it a whirl.  When setting up the field, it gave me the option right there to display it as a SSN.

 

Kind Regards,

 

Tyler Hudson
Contact Us - We Can Help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x123

saraAsaraA

There are a few issues with that:

 

1.  There are many (Most) users for whom this should still be displayed as ***-**-nnnn

 

2.  There are many outputs from apps (Most) that should print as ***-**-nnnn

 

3.  I have one app and only some of those users (one profile) that can see and print the field.

 

4.  We have it masked as last 4 characters clear, but even when I changed it to "SSN format" (the same one you see), I still see the encrypted number.

 

Maybe someone knows if there are additional rules around encrypted fields?

 

Sara

MrTheTylerMrTheTyler

Sara,

 

  This bit of info may point you in the right direction "The value of an encrypted field is only visible to users that have the “View Encrypted Data” permission."  See About Encrypted Custom Fields .

 

  Also, all kinds of extra functionality can be brought about by using a custom VisualForce page.

 

 

Kind Regards,

 

Tyler Hudson
Contact Us - We Can Help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x123

saraAsaraA

I have enabled that already - that's how I can see the value in the encrypted field - I just want to format it to make it easier to read.

 

I don't know how to do the Visual Force coding - I just want to format this field xxx-xx-xxxx.

I'd love to have a formula field read it and then display it, but that doesn't seem to be allowed.

I just don't know how to get the SSN formatted like an SSN when it's stored in an encrypted field.

 

Thanks

sara