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
FuguSailorFuguSailor 

Data visibility and access rights.

I have a VisualForce page that I'm attempting to expose as a site. When I create the SOQL query for data from the page within SalesForce, I can get data for a contact record. When the site is used to access the data, I do not recieve data if I filter based on the contact name. Same exact query performed as a SalesForce page and as the SalesForce site but when it runs as a site, I don't recieve data.

 

I've added the contact record type to the site's profile settings. The permission to the Contact record is set to read only.

 

Is there a log somewhere that I can look at for the site that might give me an idea what the issue is?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma
add without sharing keyword on your controller class
like
public without sharing class MyController {

}

All Answers

Bhawani SharmaBhawani Sharma
add without sharing keyword on your controller class
like
public without sharing class MyController {

}
This was selected as the best answer
FuguSailorFuguSailor

Never in a million years would I have expected that to be the culprit. Most of the day playing with access rights and it is as simple as changing with to without.

 

Thanks.

Bhawani SharmaBhawani Sharma
It happens and experience comes when we the issues :). Kudos :)