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
Chris CalhounChris Calhoun 

Simple page on force.com site example NOTdisplaying data

I'm only getting column headers but no data.
The page looks like this:
Customer Conversion Challenge
Name         Contact           File Number              Non Directing Date

page:
<apex:page controller="CustomerChallengeController2">
<apex:form >
  <apex:pageBlock title="Customer Conversion Challenge">
   <apex:pageBlockTable value="{!chall}" var="c">
    <apex:column headervalue="Name" value="{!c.Name}"/>
    <apex:column headervalue="Contact" value="{!c.Contact__r.Name}" />
    <apex:column headervalue="File Number" value="{!c.File_Number_Non_Directing__c}" />
    <apex:column headervalue="Non Directing Date" value="{!c.Transaction_Date_Non_Directing__c}" />

   </apex:pageBlockTable>
  </apex:pageBlock>
</apex:form>
</apex:page>

controller:
public with sharing class CustomerChallengeController2
{
public list<CustomerChallenge__c> chall{get;set;}
public list<CustomerChallenge__c> CustomerChallengeController2()
{
  if(chall == null)
   {
    chall =
    [SELECT Name, AIM_Branch__c, AIM_Division__c, Contact__c, File_Number_Directing__c, File_Number_Non_Directing__c, Transaction_Date_Directing__c, Transaction_Date_Non_Directing__c
    FROM CustomerChallenge__c];
   } 
   return chall;
}
}


Ramu_SFDCRamu_SFDC
Try changing if(chall == null) to if(chall .size()<=0)
Chris CalhounChris Calhoun
Didn't work Ramu. I even dropped the IF statement and it didn't work. I've also granted read and view all permissions on my CustomerChallenge__c object. I've enabled Apex Class Access on the controller and Visualforce Page Access on the page.

I wrote a test class for the controller and it looks like the SOQL query is returning the correct number of rows (1) so maybe the issue is in the page?
Thanks for your feedback.
Chris