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
Broad_ForceBroad_Force 

How to retrieve all records at once from VisualForce?

Hi 
Actually i  created One object name as "Apply_Leave__c".

I created Three fields to that object ,those are name,date,purpose.

I created tab to that object.

Some records are also created.

how can i access those records into the visualforce page all to see at once?

 

Help me from this doubt.

 

Thank you,

Broad Force

Alex.AcostaAlex.Acosta

There will be a limit as to how many records you can request at once. 

 

Please look at the governor limits page to see what it is since this changes from time to time.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

 

 

To see all these records you'll need your VisualForce Page, and Controller. For more options please take a look here:

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_compref_pageBlockTable.htm|StartTopic=Content%2Fpages_compref_pageBlockTable.htm|SkinName=webhelp

 

VF Page:

<page controller="Apply_Leave_Contoller">
<apex:pageblock>
<apex:pageBlockTable value="{!records}" var="record"> <apex:column value="{!record.name}"/> <apex:column value="{!record.createdDate}"/> </apex:pageBlockTable>
</apex:pageblock </page>

 

Controller:

public class Apply_Leave_Controller{

   public List<Apply_Leave__c> records {get;set;}

   public Apply_Leave_Controller(){
      records = new List<Apply_Leave__c>();
      records = [SELECT Id, Name FROM Apply_Leave__c];
   }

}