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
sooraj kesavadassooraj kesavadas 

Displaying standard set controller in visual force?

I have a user case where the community user needs to see all the appointments of all the contacts from their parent account.Here is the Code I have:
public class AppointmentListController {

public String AppFilterId {get; set;}
private Integer pageSize = 10;
private String baseQuery ='SELECT Name,, Status__c FROM appointment__c WHERE contact IN (SELECT Id FROM Contact WHERE AccountId = :myContact.AccountId)';

public AppointmentListController(){
    Contact myContact=[select id,accountid from contact where id in(select contactId from user where id=:userinfo.getuserid())];

public ApexPages.StandardSetController AppSetController {
        if(AppSetController == null){
            AppSetController = new ApexPages.StandardSetController(Database.getQueryLocator(baseQuery));
            if(AppFilterId != null)
        return AppSetController;

public AppointmentListController(ApexPages.StandardSetController c) {   }

public void firstPage()

public void lastPage()

public void next()

public void prev()

public List<appointment__c> getAppoinments()
    return (List<appointment__c>)AppSetController.getRecords();

public SelectOption[] getAppoinmentExistingViews(){
    return AppSetController.getListViewOptions();

public PageReference resetFilter()
    AppSetController = null;
    return null;

and this is my visualforce page:
<apex:page controller="AppointmentListController" sidebar="false" showHeader="false">

<apex:form id="pageForm">

   <apex:actionStatus id="ajaxStatus" startText="Loading..."  stopText=""/>

 <apex:pageBlock title="Appoinments">
    <apex:pageBlockButtons >
            <apex:commandButton action="{!firstPage}" value="|<<" reRender="AppTable"  status="ajaxStatus" />
            <apex:commandButton action="{!prev}" value="Prev" reRender="AppTable"  status="ajaxStatus" />
            <apex:commandButton action="{!next}" value="Next" reRender="AppTable"  status="ajaxStatus" />
            <apex:commandButton action="{!lastPage}" value=">>|" reRender="AppTable"  status="ajaxStatus" />

     <apex:pageBlockTable value="{!Appoinments}" var="item" id="AppTable">
         <apex:column value="{!}" headerValue="Appoinment Name"/>
         <apex:column value="{!item.Status__c}" headerValue="Status"/>
         <apex:column value="{!}" headerValue="Contact"/>


When I add this page to the community,I am getting the error "Error: Error occurred while loading a Visualforce page." What am I doing wrong here?
Are you able to test the above as Admin?
sooraj kesavadassooraj kesavadas
Hi Pawan, I am not sure how to do that, however I tried all the soql queries in a different class and it is returning the expected result.