public with sharing class StandardAccountDisplayController{ public List<Account> records {get; set;} public StandardAccountDisplayController(){ records = [select Name, AccountNumber , Phone, Industry from Account]; } }
Can you please Let me know if it works or not!!!
If it helps don't forget to mark this as a best answer!!!
This may help:
https://help.salesforce.com/articleView?id=000205631&type=1
https://trailhead.salesforce.com/en/modules/visualforce_fundamentals/units/visualforce_output_components
Cheers,Dev
VF Page:
<apex:page controller="StandardAccountDisplayController">
<apex:pageBlock title="Account List">
<apex:pageBlockTable value="{!records}" var="record">
<apex:column >
<apex:facet name="header">Account Name</apex:facet>
<apex:outputText value="{!record.Name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Account Number</apex:facet>
<apex:outputText value="{!record.AccountNumber}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Phone</apex:facet>
<apex:outputText value="{!record.Phone}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Account Industry</apex:facet>
<apex:outputText value="{!record.Industry}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Controller:
public with sharing class StandardAccountDisplayController{
public List<Account> records {get; set;}
public StandardAccountDisplayController(){
records = [select Name, AccountNumber , Phone, Industry from Account];
}
}
Can you please Let me know if it works or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj