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
lreedlreed 

Description Resource Path Location Type Save error: Unknown property 'DecoratedCM.LastName' EventCheckIn.page /RVS Working 2/src/pages line 1 Force.com save problem

I receive the following error message on VF Page Code is included below:
Description    Resource    Path    Location    Type
Save error: Unknown property 'DecoratedCM.LastName'    EventCheckIn.page    /RVS Working 2/src/pages    line 1    Force.com save problem





I Have the following code in my controller class:
void loadData() {
        members = new List<DecoratedCM>();
        for(CampaignMember m : [select Id,  ContactId, LeadId, INS_Territory__c, ANN_Territory__c, Contact.FirstName, Contact.Name,  
                                        Contact.LastName, Lead.Name,  Contact.email, Lead.email, Contact.phone,  Contact.Onyx_ID__c, 
                                        Status,LastModifiedDate 
                                from CampaignMember 
                                where CampaignId = :theCampaign.id]) {       
            members.add(new DecoratedCM(m));
            System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + m.contact.lastname);    
         }   
    }


Line on VF Page where error happens : 

<apex:column value="{!m.LastName}"/>


Any help would be greatly appreciated..

Lawrence
Best Answer chosen by lreed
James LoghryJames Loghry
It's telling you that your DecoratedCM class, presumably a wrapper class, doesn't have a variable named "LastName".  Not sure what the DecoratedCM class looks like, but if you have a member variable for CampaignMember, you could access LastName via {!m.member.Contact.LastName}, for example.

Also, please use the code formatting button (< >) when posting Apex or Visualforce.  Thanks!