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
JN22JN22 

Error: Unknown Property

Hello,

 

This is probably something pretty basic, but I am lost.  I have a custom object called Opportunity_Stage__c.  I created a custom controller because I want to have some function that opens various sections based on a user click.  However, I cannot save the controller because I keep getting the error:

 

Error: Unknown property 'Opportunity_Stage_Manager__cStandardController.Opportunity'

 

 

Can anyone help me understand why I am getting this?  My VF page and controller are below:

 

VF Page:

<apex:page standardController="Opportunity_Stage__c" tabStyle="Opportunity" ShowHeader="TRUE" extensions="EditOppMgmtController">

<apex:form >
<apex:actionFunction name="stage1Status" action="{!Stage1}" rerender="NewQualifiers" onComplete="StatusIcon();"/>
<apex:actionFunction name="stage2Status" action="{!Stage2}" rerender="NewQualifiers" onComplete="StatusIcon();"/>
<apex:actionFunction name="stage3Status" action="{!Stage3}" rerender="NewQualifiers" onComplete="StatusIcon();"/>
<apex:actionFunction name="stage4Status" action="{!Stage4}" rerender="NewQualifiers" onComplete="StatusIcon();"/>
<apex:actionFunction name="stage5Status" action="{!Stage5}" rerender="NewQualifiers" onComplete="StatusIcon();"/>

<apex:outputPanel id="msgs">
<apex:pageMessages />
</apex:outputPanel>

 

<apex:repeat value="{!Opportunity_Stage_Manager__c}" var="opp">


<apex:outputPanel rendered="{!IF(opp.Opportunity_Type__c = 'New Business','true','false')}">


<!-- HEADER ROWS -->

<table columns="2" width="100%" >
<tr>
<td width="15%" >
Sales Rep:
</td>
<td width="30%" >
{!Opportunity.Owner.Name}
</td>
<td width="5%">
&nbsp;
</td>
<td align="right" width="25%">
<apex:commandLink id="Stage1n" value="Stage 1 - Identify Target" onComplete="stage1Status();" />&nbsp;&nbsp;&nbsp;
</td>
<td width="20%" >
<hr style="height:15px; border:none;
margin:0;" align="left" width="0%"/>
</td>
<td width="5%">
{!IF(opp.S1_New_Completed__c=null,0,opp.S1_New_Completed__c)}%
</td>
</tr>

<tr>
<td width="15%" >
Account Name:
</td>
<td width="30%" >
{!Opportunity.Account.Name}
</td>
<td width="5%">
&nbsp;
</td>
<td align="right" width="25%">
<apex:commandLink id="Stage2n" value="Stage 2 - Qualify Target" onComplete="stage2Status();" />&nbsp;&nbsp;&nbsp;
</td>
<td width="20%" style="border: 2px solid silver;padding:none">
<hr style="height:15px; border:none;
margin:0;" align="left" width="0%"/>
</td>
<td width="5%">
{!IF(opp.S2_New_Completed__c=null,0,opp.S2_New_Completed__c)}%
</td>
</tr>

</table>

 

<!--QUALIFIER TABLES-->

<apex:outputPanel id="NewQualifiers">
&nbsp;<br/>
&nbsp;<br/>
<apex:outputPanel rendered="{!IF((Stage1Qual=True || (Stage1Qual=False && Stage2Qual=False && Stage3Qual=False && Stage4Qual=False && Stage5Qual=False)),'true','false')}">
<table width="100%">
<tr >
<td colspan="6">
<div >STAGE 1 - IDENTIFY TARGET</div><br></br>
</td>
</tr>
<tr >
<td width="1%" colspan="3" align="center">
Stages
</td>
<td width="5%">
Status
</td>
<td width="10%">
Date Completed
</td>
<td width="35%">
Comments
</td>
</tr>

<tr valign="middle" >
<td colspan="6"><br/></td>
</tr>

<tr valign="middle" >
<td width="1%">
&nbsp;
</td>
<td width="1%">
<img src="/s.gif" alt="" class="helpOrb" title="Why this stage?"/>
</td>
<td width="29%">
Cconfirmed
</td>
<td width="5%" align="center">

<div id="StatusIcon" >
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP7" class="icon default" id="R" name="s1q1n"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP8" class="icon" id="Y" name="s1q1n"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP6" class="icon" id="G" name="s1q1n"/>
</div>
</td>
<td width="10%" align="center">
<apex:inputField value="{!opp.S1Q1_New_Date__c}" />
</td>
<td width="35%">
<apex:inputField value="{!opp.S1Q1_New_Comments__c}" Style="width:98%"/>
</td>
<td width="1%">
<apex:inputField value="{!opp.S1Q1_New__c}" styleClass="s1q1n" style="visibility:hidden; width:10%;"/>
</td>
</tr>

<tr valign="middle" >
<td colspan="6"><br/></td>
</tr>
<tr valign="middle" >
<td colspan="6"><br/></td>
</tr>

<tr valign="middle">
<td width="1%">
<img src="/servlet/servlet.FileDownload?file=015S0000000S3wj" alt="Essential" title="Essential"/>
</td>
<td width="1%">
<img src="/s.gif" alt="" class="helpOrb" title="What are the client's Needs"/>
</td>
<td width="29%">
Client shared a problem
</td>
<td width="5%" align="center">

<div id="StatusIcon" >
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP7" class="icon default" id="R" name="s1q2n"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP8" class="icon" id="Y" name="s1q2n"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP6" class="icon" id="G" name="s1q2n"/>
</div>
</td>
<td width="10%" align="center">
<apex:inputField value="{!opp.S1Q2_New_Date__c}" />
</td>
<td width="35%">
<apex:inputField value="{!opp.S1Q2_New_Comments__c}" Style="width:98%"/>
</td>
<td width="1%">
<apex:inputField value="{!opp.S1Q2_New__c}" styleClass="s1q2n" style="visibility:hidden; width:10%;"/>
</td>
</tr>

</table>

</apex:outputPanel>

</apex:repeat>
</apex:form>

</apex:page>

 

 

Controller:

 

public class EditOppMgmtController{

public EditOppMgmtController(ApexPages.StandardController stdcontroller) {}

public boolean Stage1Qual {get; set;}
public boolean Stage2Qual {get; set;}
public boolean Stage3Qual {get; set;}
public boolean Stage4Qual {get; set;}
public boolean Stage5Qual {get; set;}

public void Stage1() {
Stage1Qual = true;
Stage2Qual = false;
Stage3Qual = false;
Stage4Qual = false;
Stage5Qual = false;
}
public void Stage2() {
Stage1Qual = false;
Stage2Qual = true;
Stage3Qual = false;
Stage4Qual = false;
Stage5Qual = false;
}
public void Stage3() {
Stage1Qual = false;
Stage2Qual = false;
Stage3Qual = true;
Stage4Qual = false;
Stage5Qual = false;
}
public void Stage4() {
Stage1Qual = false;
Stage2Qual = false;
Stage3Qual = false;
Stage4Qual = true;
Stage5Qual = false;
}
public void Stage5() {
Stage1Qual = false;
Stage2Qual = false;
Stage3Qual = false;
Stage4Qual = false;
Stage5Qual = true;
}
}

 

Best Answer chosen by Admin (Salesforce Developers) 
Juan SpagnoliJuan Spagnoli

Because you're using "Opportunity" instead of your var "opp".

 

By the way you don't need the repeat tag, repeat is for collection and you have a single object. You must use:

 

{!Opportunity_Stage__c.Owner.Name}

 

Regards.

All Answers

Juan SpagnoliJuan Spagnoli

Because you're using "Opportunity" instead of your var "opp".

 

By the way you don't need the repeat tag, repeat is for collection and you have a single object. You must use:

 

{!Opportunity_Stage__c.Owner.Name}

 

Regards.

This was selected as the best answer
Avidev9Avidev9

I am not sure what is the relationship between Opportunity stage and Opportunity.
So if Opportunity stage is child of Opportunity you can access Opportunity field by doing

{!Opportunity_Stage__r.Opportunity.Owner.Name}

 Likewise you can access the other fields.

 

The catch is you can access the fields of the object that is declared in StandardController and hence you have to start refering from Opportunity Stage.

JN22JN22

That was it Juan.  I just missed that I was using Opportunity rather than my custom object.  Thanks!