You need to sign in to do that
Don't have an account?
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; } }
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
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.
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