Skip to main content
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
1 answer
  1. Nov 6, 2015, 4:29 AM
    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!
0/9000