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
justynjustyn 

Public viewing of data in a visualforce page

I have a custom object search page work based on the excellent template by Jeff Douglas at http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/

 

The page works fine when logged into the system, but I require it to be publicly viewable. I've added it to my Sites and can view everything apart from the data! Any thoughts? I have made the relevant Custom Object as Read in the Guest Profile.

 

Thanks in advance

 

Justyn

TejTej

may be "View All"data needs to be enabled in your guest profile for that object.

justynjustyn

Hi

 

Thanks for the idea. I get the following error when I enable View All data:

 

Permission Read All Counselling Practices depends on permission(s): Read All Contacts

Error: Invalid Data. 
Review all error messages below to correct your data.

 

I have no option to be able to Read All COntacts so I'm at a dead end.

 

Justyn

hemantgarghemantgarg

There can be a workaround, create a wrapper class and create properies for each fields which you want to show on page, after that display the wrappers instead of the contact records, it should work.

But before doing it please check following:-

1) The field level security on contact fields for the guest profile.

2) Try to add without sharing keyword just with the controller class name(if the records are not getting from the SOQL query)

 

Make sure your data security before implementing this workaround, because it will expose all the data on public site.