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
Karina ChangKarina Chang 

Visualforce to see all my opportunitites

Hi,
I need to create a visualforce page with a list of all opportunities that are in the system.
Not sure where to start... I was able to find some examples, but the show how to display opportunity information but they needed to have the ID on the URL. I just need a list of all opportunities.

Thanks!  
Best Answer chosen by Karina Chang
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Here you go
<apex:page standardController="Opportunity" recordSetVar="opportunities">
    <apex:pageBlock title="All Opportunities">
        
        <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>

All Answers

renaiah anamalla 7renaiah anamalla 7
<apex:page statndardcontroller="opportunity">
<apex:form>
<apex:pageblock>
<apex:pageblocktable value="{items}" var="o">
<apex:column value ="{!o.Name}"/>
<apex:column value="{!o.stage}"/>
//try it 
</apex:pageblock>
</apex:form>
</apex:page>

you use recordsetvar 
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Here you go
<apex:page standardController="Opportunity" recordSetVar="opportunities">
    <apex:pageBlock title="All Opportunities">
        
        <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>
This was selected as the best answer
Karina ChangKarina Chang
thanks!!!