• Chris Morrison 7
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I am new to development and working on a VF page that will show data from Opportunity, Account and Contact Roles. The standard controller is Opportunity and have tried to build an extension to bring in the parent Account data I need. I started with a list controller and can't get the data to display in an Apex:Output field tag. I get an error that says" Unknown property 'VisualforceArrayList.Account'". It does work when using an apex:PageBlockTable and setting the value of the table to the variable. I don't need or want a table I just want an Output. Here is my controller syntax:
public class DealReviewSheetContactRoleExtension{
    public list<Opportunity> Acco{
        get;
        set;
    }
    public DealReviewSheetContactRoleExtension(
    	ApexPages.StandardController controller
    ){
        Acco = 
            [SELECT
            	Account.Name,
            	Account.AnnualRevenue,
             	Account.BillingAddress
        
            FROM
            	Opportunity
            WHERE
            	Id =
            	:((Opportunity)controller.getRecord()).Id
            ];
    }
}
and here is the relevent block on the VF page:
<apex:pageBlock >
            <apex:pageBlockSection >

                <apex:outputField value="{!Opportunity.Name}" label="Point Person:"/>
                <apex:outputField value="{!Acco.Account.AnnualRevenue}" label="Annual Revenue"/>
Any guidance would be greatly appreciated!