0

Visualforce page

 <apex:variable value="{!record.Reservation__c}" var="Client">


        <p align="left" >

            full {!Client.Name} <br/>
            address{!Client.Contact__r.AddressOne__c}<br/>
            address {!Client.Contact__r.City__c}<br/>

            address {!Client.Contact__r.StateOrProvince__c}<br/>
            address {!Client.Contact__r.PostalCode__c}<br/>

            <br/>
            Dear firstname:
        </p></apex:variable>

Controller

    public List<Reservation__c > getRecords(Id reservationId) {
    List<Reservation__c > records = [Select Client_Name__c , Reservation_ID__c ,  Number_of_Guests__c, Arrival_Date__c ,Departure_Date__c, Total_Price__c, 
                                     Contact__r.Name, Contact__r.AddressOne__c, Contact__r.City__c, Contact__r.StateOrProvince__c, Contact__r.PostalCode__c 
                                //        ,(Select AddressOne__c , City__c, StateOrProvince__c     From Contact__r )
                               //        (Select Name, Unit_Price__c From Purchase_Lookup__r ORDER BY Name ASC)
                                     From Reservation__c 

                                     WHERE Id =: reservationId                                        
                                     ];

    return records;
}

I'm trying to create a pdf invoice from reservation. But I'm keep getting "Unknown property 'GenerateInvoiceController.record'" Error message. Can you guys tell me what went wrong?

Thank you in advance.

  • What is "record" supposed to be? What is "record.Reservation__c" supposed to be? Does the page have a standardController attribute? How is getRecords called? How are these records related? There's simply too many unanswered questions here to help you. Please edit your question to include more details about this code. It's obvious from the error that there's no controller/extension variable/method named record/getRecord, but aside from that, there's simply not enough information. – sfdcfox Sep 21 '18 at 9:58
0

The VF code is actually using a variable called {!record}

<apex:variable value="{**!record**.Reservation__c}" var="Client">

Bu your class has no record variable. It actually has a method called getRecords()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.