We are trying to creating a text field where we can enter the full credit number, but once the record is saved it only displays the last 4 number.

I know salesforce offers encrypted fields, but an admin can change that at anytime; would it require a trigger to have this field to only always display the last 4 digits.

Does anyone have experience doing this or any suggestions?

  • 4
    If you are processing payments on that credit card you should be using tokenization. Don't store the card number - Problem solved. And there are apps that do this and more for you around payment processing
    – Eric
    Mar 2, 2017 at 16:02
  • We are trying to capture it, so it can be used in future payments, would it still be tokenization?
    – B Wayne
    Mar 2, 2017 at 16:04
  • 1
    Yes, auth, capture, charge, etc, if enabled in gateway will return a token that you would store instead of the credit card number. Token can then be used in SF or other systems etc that use the same gateway account and make a charge against the token. (Full disclosure I am affiliated with - appfrontier.com) some good reading in the link provided even if you choose not to look at the app
    – Eric
    Mar 2, 2017 at 16:06


You must log in to answer this question.

Browse other questions tagged .