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
manjunath vivekmanjunath vivek 

Not able to retrieve the fields to VF page from contact.

I am not able to retrieve the fields from contact,can some one help me  on this?

<apex:page standardController="contact" recordSetVar="contact">
<apex:pageBlock title="Viewing Contacts">
<apex:form id="theForm">
<apex:pageBlockSection >
<apex:pageBlockTable value="{!contact}" var="c" id="List">
{!c.name}    
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>
BalajiRanganathanBalajiRanganathan
you need to have different name for recordsetvar.
also you need to have apex:column inside
<apex:column value="{!c.name}"/>

Try this
<apex:page standardController="contact" recordSetVar="contacts">
<apex:pageBlock title="Viewing Contacts">
<apex:form id="theForm">
<apex:pageBlockSection >
<apex:pageBlockTable value="{!contacts}" var="c" id="List">
<apex:column value="{!c.name}"/>    
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>


 
manjunath vivekmanjunath vivek
Hi Balaji,

Thanks for pickingup my question, I have tried your code, still not works



















 
manjunath vivekmanjunath vivek
 User-added image





I am sending you the screen shot.



 
BalajiRanganathanBalajiRanganathan
Looks like, Salesforce initialize the list with default list view selected by user. mostly it might be the contact having birthdate this month. create a list view with all contact records. also show the list view in the VF page as given the link below.

https://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_list_views.htm

else you to have the controller extension to get the all contacts. i am not sure if there is an easy way to get all the contacts.