+ Start a Discussion

I need help creating a visualforce page that returns a table of filtered data from opportunities

I want to create a list of opportunities on a visualforce page so I can add them to our dashboard.
VIsualforce page has limitation on no of records it can display . Limit is 1000. beyond that you need to use paginiation. 
You can use pageblock table to display records if you are sure that count will be less than 1000 

Mahesh DMahesh D
Hi Tadd,

In addition to Venky's comments, please go through the below link to make it editable list:


if you don't want to edit it, just to display then you can use PageBlockTable example and retrieve the results;

Sample code for PageBlockTable is:
<apex:page standardController="Account">
    <apex:pageBlock title="List of Contacts">
        <apex:pageBlockTable value="{!Account.Contacts}" var="acc">
            <apex:column value="{!acc.Name}"/>
Along with Venky's link, you can also look into below options:


This one will shows you different other components to display table kind of output.


Please let me know if this helps you.

Forgive my ignorance on the subject, I am not very experienced with VisualForce. Below is the table I would like to have on a VF page.

User-added image
Based on your help I came up with the following which returns a blank page:

<apex:page standardController="Opportunity">

    <apex:pageBlock title="Work Ticket Status">

        <apex:pageBlockTable value="{!Opportunity}" var="Work_Ticket_Status__c">

            <apex:column value="{!Work_Ticket_Status__c}"/> 



Mahesh DMahesh D
If you want to retrieve list of Opportunities from the Org:
<apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="OpportunityExtController">

        <apex:pageblock id="CustomList" title="Related Opportunities"  >
            <apex:pageBlockTable value="{!oppList}" var="o" rendered="{!NOT(ISNULL(oppList))}">
             <apex:column value="{!o.Name}"/>
             <apex:column value="{!o.Account.Name}"/>
             <apex:column value="{!o.Type}"/>
             <apex:column value="{!o.Amount}"></apex:column>
             <apex:column value="{!o.CloseDate}"/>
            <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppList))}" styleClass="noRowsHeader">
public class OpportunityExtController {
    public List<Opportunity> oppList {get; set;}
    public OpportunityExtController(ApexPages.StandardController controller) {
        oppList = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity];

Please do let me know if it helps.


Can you help me recreate the example listed on SF.com below using the following fields from my Opportunities?
I need three columns where the example only has two, the opportunity fields are "Work_Ticket__c" "Name" and "Questions_and_Comments__c"