You need to sign in to do that
Don't have an account?
Nawar Shammu
Error: Unknown property 'OpportunityStandardController.line2'
Hi there,
I am using the below code and am getting the above error message, this is quiet crucial to business at this very second, can someone please assist.
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf">
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<p align="right">
<img src='{!URLFOR($Resource.SF_Logo_TI)}' title="logo" /></p>
<tr align="right"> <td><font face="Arial"></font>
</td></tr>
<hr/>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<td width="0%"></td>
<td align="left"><font face="Arial">Invoice number: <apex:repeat value="{!Opportunity.Invoices__r}" var="line2">
{!line2.name}</apex:repeat></font><br/>
<font face="Arial">Invoice Date: <apex:outputText value="{0,date,MM/dd/yyyy}">
<apex:param value="{!line2.Invoice_Date__c}"/>
</apex:outputText></font></td>
I am using the below code and am getting the above error message, this is quiet crucial to business at this very second, can someone please assist.
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf">
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<p align="right">
<img src='{!URLFOR($Resource.SF_Logo_TI)}' title="logo" /></p>
<tr align="right"> <td><font face="Arial"></font>
</td></tr>
<hr/>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<td width="0%"></td>
<td align="left"><font face="Arial">Invoice number: <apex:repeat value="{!Opportunity.Invoices__r}" var="line2">
{!line2.name}</apex:repeat></font><br/>
<font face="Arial">Invoice Date: <apex:outputText value="{0,date,MM/dd/yyyy}">
<apex:param value="{!line2.Invoice_Date__c}"/>
</apex:outputText></font></td>
It seems you have unintentionally closed the apex:repeat tag before invoice date. Try below code for <td> (Simply move close tag for repeat before the close tag for td element)
as the loop has been closed "</repeat>" the variale doesn't exist anymore and the Standard Controller tries to translate your formula
{!line2.Invoice_Date__c} encountering the fact that "line2" is neither a variable or a field within the Opportunity object, respectively the error is thrown.
If you follow Nalids advise to move the closing repeat tag behind </font> tag, you should be fine