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
Robert Wambold 10Robert Wambold 10 

Can't figure out Unknown property 'JoinedProposalCheckController.Opportunity'

Hello All!

I have been banging my head try to figure out Unknown property 'JoinedProposalCheckController.Opportunity'. I am hoping a 2nd set of eyes will see the cause.

My VF page will eventually execute when the user clicks a button on the Opportunity page, but for now I have hard-coded a value. The purpose of my VF page will be to display Opportunities with a common value in OS_Number__c and finally link to an Opportunity that needs review.

So, my problem at present is I cannot see what is causing Unknown property 'JoinedProposalCheckController.Opportunity'.

Thank you for reading and helping.

Kind regards,

Robert

 

Here's my code:

 

VFP.

<apex:page Controller="JoinedProposalCheckController" showHeader="true" sidebar="false" >  
     <apex:form id="JPForm">  
          <apex:pageBlock title="Opportunities List" >   

   			<apex:pageBlockSection >
				{!$User.FirstName} {!$User.LastName}
			</apex:pageBlockSection>
			     
            <apex:pageBlockSection >         
               <apex:pageBlockTable value="{!Opportunity}" var="op" width="100%">
                    <apex:column HeaderValue="Select">
						<apex:outputText Value="{!op.Op.Id}"></apex:outputText>
                        <apex:outputText Value="{!op.Op.Name}"></apex:outputText>
                        <apex:outputText Value="{!op.Op.Account.Name}"></apex:outputText>
                        <apex:outputText Value="{!op.Op.OS_Number__c}"></apex:outputText>
                        <apex:outputText Value="{!op.Op.Opportunity_Number__c}"></apex:outputText>
                        <apex:outputText Value="{!op.Op.Joint_Proposal__c}"></apex:outputText>   
					</apex:column>
               </apex:pageBlockTable> 
            </apex:pageBlockSection>                 
        
          </apex:pageBlock>    
     </apex:form>
</apex:page>
 

APXC.

public class JoinedProposalCheckController {

    public List<Opportunity> opptyList {get;set;}

    	public JoinedProposalCheckController() {
		   populateOpptyList();
	    }

        private void populateOpptyList() {    
           opptyList = [SELECT Id, Name, Account.Name, OS_Number__c, Opportunity_Number__c, Joint_Proposal__c   
                        FROM Opportunity 
                        WHERE OS_Number__c = '44831']; 
        }
      
        public List<Opportunity> getopptyList() {
          return opptyList;        
        }    
}
Best Answer chosen by Robert Wambold 10
Agustin BAgustin B

Hi robert, the name is not Opportunity, it should be opptyList , thats why you get that error.

<apex:pageBlockTable value="{!opptyList}" var="op" width="100%">

if it helps please like and mark as correct.
Good luck.

All Answers

Agustin BAgustin B

Hi robert, the name is not Opportunity, it should be opptyList , thats why you get that error.

<apex:pageBlockTable value="{!opptyList}" var="op" width="100%">

if it helps please like and mark as correct.
Good luck.

This was selected as the best answer
Robert Wambold 10Robert Wambold 10

Hi Agustin!

That was it! Thank you for your fast response and help!

Now on to adding Column Names, creating Link to Opportunity.

Kind regards,

Robert