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
hamayoun65hamayoun65 

Data Not Available error

Hello

 

I am overriding the Edit and View buttons of a custom object with a VF page.  When I try and access a record which, ouside VF, would not be accessible by a specific user, I get the 'Data Not Available' error when bringing up the VF page for that specific user.  However, I thought that VF pages run as the system user.  So why am I getting this problem?  Any work rounds?

 

Thx,

Hamayoun

TehNrdTehNrd

Apex runs as the system user. Visualforce pages respect user permissions. I'm going to guess you are using the apex:detail component? This respects user permissions.

hamayoun65hamayoun65

It would appear that when you use a standard controller, even with an extension, that it then respects the current user.  So the solution is to get rid of the standard controller.  This, of course, prevents me from overring the pages, and also from using, like TheNerd mentioned, the apex:detail component.  Grr!!!!!

hamayoun65hamayoun65

Now that I think about it, I can override using a sControl which redirects to the VF page.