0

I have a controller and a vf component that'll create a visualforce email template attachment.

The error I get when trying to render the VF portion is:

Unknown property 'VisualforceArrayList.CurrencyIsoCode'

This is tied to the first CurrencyISOCode field listed in the vf component below. How can I reference the parent object to display in the visualforce component.

Visualforce Component is as follows (partially):

<apex:component controller="QuoteLineEmailController" access="global">
<apex:attribute name="theQuoteID" type="Id" description="Id of the Quote" assignTo="{!QuoteID}"/>
<apex:outputPanel >
<table width="100%"  border="0" cellpadding="1" cellspacing="1" 
  style="border-collapse:collapse;border-color:white;font-family:Helvetica;">

<tr>
<td >Subtotal before Trade in:</td>
<td ><apex:variable value="{!Quotee}" var="Quote">{!Quote.CurrencyIsoCode} 
</apex:variable>
    <apex:variable value="{!Quotee}" var="Quote">
            <apex:outputText value="{0, number, ###,##0.00}">
                    <apex:param value="{!Quote.Subtotal_Before_Trade_In__c}" />
                </apex:outputText>
     </apex:variable></td>
<td >Total:</td>
<td ><apex:variable value="{!Quotee}" var="Quote">{!Quote.CurrencyIsoCode} 
</apex:variable>
    <apex:variable value="{!Quotee}" var="Quote">  
            <apex:outputText value="{0, number, ###,##0.00}">
                    <apex:param value="{!Quote.Net_Amount_Internal__c}" />
                </apex:outputText>
    </apex:variable></td>
  </tr>   
</table>    
</apex:outputPanel>

Apex Class Controller:

public class QuoteLineEmailController {

    public id QuoteID {get;set;}

    public list<SBQQ__Quote__c> getQuotee() {
    list<SBQQ__Quote__c> Quote = [Select Name, ID, Subtotal_Before_Trade_In__c, Trade_In__c, Net_Amount_Internal__c,CurrencyIsoCode
                    FROM SBQQ__Quote__c 
                    WHERE ID = :QuoteID];  
    return Quote;
    }    

    public list<SBQQ__QuoteLine__c> getQuoteLines() {

        list<SBQQ__QuoteLine__c> QLI = [SELECT  Name, Product_Name_and_Description__c
                                        FROM SBQQ__QuoteLine__c 
                                        WHERE SBQQ__Quote__c = :QuoteID ORDER by Name];

        return QLI;   
    }                 

}
1
  • As an aside, there's no need to use apex:variable more than once, as it is set for the remainder of the page regardless of where it appears in the code.
    – sfdcfox
    Apr 13, 2017 at 19:15

1 Answer 1

0

You're returning a list, despite only returning one record, so it's expecting a list operation (e.g. using it in an apex:repeat). Change the return type to just a single object:

public SBQQ__Quote__c getQuotee() {
    return QuoteId == null? null:
        [Select Name, ID, Subtotal_Before_Trade_In__c, Trade_In__c, Net_Amount_Internal__c,CurrencyIsoCode
         FROM SBQQ__Quote__c 
         WHERE ID = :QuoteID];  
}    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .