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
Nawar ShammuNawar 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>
Lalit Mistry 21Lalit Mistry 21
Hi Nawar,
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)
<td align="left"><font face="Arial">Invoice number: <apex:repeat value="{!Opportunity.Invoices__r}" var="line2">
   {!line2.name}</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></apex:repeat></td>

 
MoggyMoggy
Agreed with Nalid, You declared the variable "line2" for the use within the repeat loop, you closed the repeat loop and then point again to line2
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