7

In an org where Contact.Name is encrypted via Salesforce Shield Platform Encryption and for an SA user (where the SA profile has "View Encrypted Data" unchecked) normal list views and detail pages mask the name by displaying ****** ************ instead of the name as expected.

However, this Visualforce displays the name not masked:

<apex:page standardController="Contact">
    <apex:outputField value="{!Contact.Name}"/>
</apex:page>

Reviewing the documentation I can see no mention of Visualforce support, thought there is this "Custom Lightning Components" comment:

When viewed in a custom Lightning component, encrypted data is not masked, even if the user doesn't have the "View Encrypted Data" permission.

So can anyone confirm that encrypted fields are not masked in Visualforce? Are we meant to write our own masking logic?

PS

The page is using API 37 and I get the same problem with a non-SA profile i.e. the unmasked name is presented when "View Encrypted Data" is unchecked. The org is eu11 which doesn't move to Winter '17 until Saturday. I don't see this specific problem posted in Known Issues.

  • i assume the VF page is at least Summer 15? – cropredy Oct 3 '16 at 18:15
  • @cropredy Yeah was a page create via the web Setup UI so current API version. – Keith C Oct 3 '16 at 23:33
  • I just tried this and it worked just fine for me(value masked in VF as well). So i can surly tell you that its not VF issue. – AtulRajguru9 Oct 5 '16 at 0:43
  • Just FYI there was bug in older version. you may want to double check the API version is 37. – AtulRajguru9 Oct 5 '16 at 0:44
  • @AtulRajguru9 Did just double check the version and it is 37. Perhaps it is something to do with the profile - as I mentioned in the question I just tested as SA? Any other thoughts on what I might be missing? But great to know that it does work. – Keith C Oct 5 '16 at 8:29
1
+50

There does appear to be an issue with the Name field in particular --- if you use First Name or Last Name individually, however, the data IS returned encrypted. I'd report this as a bug -- but at least you can workaround it by composing Name from its component fields.

Here's the VF page I used for testing:

<apex:page standardController="Contact">
    Name: <apex:outputField value="{!Contact.Name}"/><br/>
    First Name: <apex:outputField value="{!Contact.FirstName}"/><br/>    
    Last Name: <apex:outputField value="{!Contact.LastName}"/><br/>        
</apex:page>

Which returned these results:

Encrypted Contact data

  • 1
    Thanks - taking your page I see exactly the same thing. Have opened a case. A colleague had a masked field appearing unmasked in a report too; looks like there are some holes in this at the moment. – Keith C Oct 10 '16 at 15:39

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.