Displaying Records using VF!

November 24, 2017

Individual Records

Display Individual Fields

<apex:pageBlock title="Leads" >

<apex:pageBlockSection title="Email Dupicates" collapsible="true" >
<apex:outputField value="{! Lead.FirstName}"/>
<apex:outputField value="{! Lead.LastName}"/>
<apex:outputField value="{! Lead.Email}"/>
<apex:outputField value="{! Lead.Company}"/>
</apex:pageBlockSection>

<apex:pageBlockSection title="Lead Details" collapsible="true" >
<apex:detail />
</apex:pageBlockSection>

Display Multiple Records

 

<apex:page title="Account Details" showHeader="false" sidebar="false" standardController="Account">

<apex:pageBlock title="Accounts">

<apex:detail relatedList="false" />

</apex:pageBlock>

<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{!Account.contacts}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.Title}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>

</apex:page>