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
Parmeshwar Bhore 1010011Parmeshwar Bhore 1010011 

How to Create a visualforce Page to display opportunity object Records from salesforce org

Akshay Dhiman 63Akshay Dhiman 63
Hi Parmeshwar,

Please follow this instruction to create the visualforce page to display opportunity object records.

1. First open the Developer Console.
2. Click on the File and go to New Option.
3. Create a VisualForce Page.
4. After Creating the visualForce page please paste the below line of code.

<apex:page standardController="Opportunity" recordSetVar="opportunities">
    <apex:pageBlock title="Opportunity List">
       <apex:pageBlockTable value="{!opportunities}" var="opp">
           <apex:column value="{!opp.Name}"/>
           <apex:column value="{!opp.StageName}"/>
           <apex:column value="{!opp.CloseDate}"/>
           <apex:column value="{!opp.Account.Name}"/>
       </apex:pageBlockTable> 
    </apex:pageBlock>
</apex:page>

5. After pasting save the file.
6. To preview the visual force page click on the left side button "Preview".

Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.
Thanks
Akshay
SwethaSwetha (Salesforce Developers) 
HI Parmeshwar,
Adding to the above, I recommend the trailhead module https://trailhead.salesforce.com/en/content/learn/modules/visualforce_fundamentals/visualforce_output_components that gives a good understanding of VisualForce concepts.  Thanks