I'm currently trying to replicate the functionality of Connected App's Consumer Secret. Just as a reference, the field looks like this when you first open a Connected App (Setup > Apps > Connected Apps):

enter image description here

And when the field is clicked on, it looks like this:

enter image description here

I want to be able to replicate this for a custom Encrypted Text field. I found this method of putting this Hyperlink that references the value from the text field in a formula:

HYPERLINK('javascript:var x=document.getElementById("IDHERE_ilecell").innerHTML = "'+Text__c+'";',  'Show' )

Unfortunately, this does not work with Encrypted Text fields, which are not allowed in formula fields. I know an alternative would be to create a VisualForce page and use JS to hide it behind a link, but I'm leaving that as a last resort.

Is there any other know way of replicating that functionality on the Encrypted Text field?

Let me know if any other information is needed, and thank you in advance!

  • Are there any criteria to be able to see the value, or can anyone just click and see? Also, if a user returns to the page afterwards, do you want him to still see the revealed value or should he click again? Feb 11 '16 at 7:37
  • @RobinDeBondt Any user should be able to click and see the direct fields value. So in this case, if the value for a user is ****, they will click and see ****, or if the value is 1234 they will see 1234. The field should have to be clicked every time the page is re-opened. Feb 11 '16 at 16:28

So I looked around SE and other sites to see if I could find an answer to this, and I wasn't able to. In the end I created a small VF page that was accessible through a hyperlink formula field, and had the password displayed on there, which essentially filled the requirements that were given. As a side note, I did find some answers about injecting JS into the page to hide the field, but all were very hacky and not supported by Salesforce, which wasn't a risk I was will to take.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.