You need to sign in to do that
Don't have an account?
Dimitris
Visual Force - Error: Unknown property 'OpportunityStandardController.Contract'
Hi
I am new in this field and still learning; I tried to add the below to display some information from my product in the T&Cs
but it returns the following error Error: Unknown property 'OpportunityStandardController.Contract'
<apex:repeat value="{!Contract.Opportunity_Product__r}" var="line">
<tr>
<td>{!line.Product2.Name}</td>
<apex:outputText rendered="{!If(line.Product2.Early_Termination_Clause__c!=Null,True,False)}">
<td style="text-align:center">{!line.Product2.Early_Termination_Clause__c}</td>
</apex:outputText>
<apex:outputText rendered="{!If(line.Product2.Early_Termination_Clause__c==Null,True,False)}">
<td style="text-align:center">No Clause Available</td>
</apex:outputText>
</tr>
</apex:repeat>
I am new in this field and still learning; I tried to add the below to display some information from my product in the T&Cs
but it returns the following error Error: Unknown property 'OpportunityStandardController.Contract'
<apex:repeat value="{!Contract.Opportunity_Product__r}" var="line">
<tr>
<td>{!line.Product2.Name}</td>
<apex:outputText rendered="{!If(line.Product2.Early_Termination_Clause__c!=Null,True,False)}">
<td style="text-align:center">{!line.Product2.Early_Termination_Clause__c}</td>
</apex:outputText>
<apex:outputText rendered="{!If(line.Product2.Early_Termination_Clause__c==Null,True,False)}">
<td style="text-align:center">No Clause Available</td>
</apex:outputText>
</tr>
</apex:repeat>
Here:
<apex:repeat value="{!Contract.Opportunity_Product__r}" var="line">, does !Contract.Opportunity_Product__r returns the list of records, seems it is a lookup and will return only one record.
Instead of using apex:repeat, you can use it this way:
<tr>
<td>{!Opportunity.Contract.Opportunity_Product__r.Product2.Name}</td>
<apex:outputText rendered="{!If(!Opportunity.Contract.Opportunity_Product__r.Product2.Early_Termination_Clause__c!=Null,True,False)}">
<td style="text-align:center">{!!Opportunity.Contract.Opportunity_Product__r.Product2.Early_Termination_Clause__c}</td>
</apex:outputText>
<apex:outputText rendered="{!If(!Opportunity.Contract.Opportunity_Product__r.Product2.Early_Termination_Clause__c==Null,True,False)}">
<td style="text-align:center">No Clause Available</td>
</apex:outputText>
</tr>
Mark it solved if it does help you.
Thank you for the quicke response - while adding your suggestion it shows me the following error
Error: Unknown property 'VisualforceArrayList.Product2'
Seems Product2 should not be there, assuming your custom field is lookup to product, could you please try below code:
<tr>
<td>{!Opportunity.Contract.Opportunity_Product__r.Name}</td>
<apex:outputText rendered="{!If(!Opportunity.Contract.Opportunity_Product__r.Early_Termination_Clause__c!=Null,True,False)}">
<td style="text-align:center">{!!Opportunity.Contract.Opportunity_Product__r.Early_Termination_Clause__c}</td>
</apex:outputText>
<apex:outputText rendered="{!If(!Opportunity.Contract.Opportunity_Product__r.Early_Termination_Clause__c==Null,True,False)}">
<td style="text-align:center">No Clause Available</td>
</apex:outputText>
</tr>
Error: Unknown property 'VisualforceArrayList.Name'
Basicacally what i am trying to achieve is to display the text of the field Early termination clause for each product.