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

Sites not displaying any Object Data

I have created a very simple page to simply display a list of Accounts.  I am trying to make this list visible on a Sites page so I can demo some functionality to my team. 

Nothing I've tried yet has allowed me to display any object data, though the page renders fine within SFDC. 

Here's the code for the page.

<apex:page standardcontroller="account" showheader="true" recordsetvar="accounts">

<apex:form >
    <apex:pageblock title="All Accounts">
<apex:pageblockTable value="{!accounts}" var="a"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.createddate}"/>
</apex:pageblock> </apex:form> </apex:page>

I have made sure that the Field Level Security is set to "Visible" for these fields.  Also, the Site Page Profile has "Read" Access to the Account object.

Can anyone recommend other things I should be looking at to get this (very simple) page to display? 

Thanks for any ideas!

Best Answer chosen by Admin (Salesforce Developers) 
please take a look at:

Message Edited by Bulent on 12-29-2008 09:58 AM

All Answers

Your visualforce page would work for fine authenticated users since it'll use the last used filter.
However, last user filter has no value for the anonymous access.
i am having a similar issue.  So, how do I 'authenticate' as a user in my code?

if you are facing the same issue posted originally then please tae a look at the " Using List Views with Standard List Controllers" section of the Visualforce guide.

if it's not the same issue then check the sharing for the object. If it's set to private sharing then you would need to create a sharing rule to share the records with the site guest user.

Message Edited by Bulent on 11-26-2008 09:24 AM
I am having the same issue, the object is set to public access. Any ideas? 
please take a look at:

Message Edited by Bulent on 12-29-2008 09:58 AM
This was selected as the best answer