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
RajashriRajashri 

Unknown Property Error in VF Page

Hi,

I am new to salsforce.I want to display the Campaign Members through VisualForce Page.I have wrriten the below code.I am getting the error as Unknown Property value.

Can anyone please help

VF page

<apex:page controller="callCampaignController">
    <apex:sectionHeader title="My Call List"></apex:sectionHeader>
    <apex:form >
        <apex:pageBlock title="">
          <!-- To show page level messages -->
          <apex:pageMessages ></apex:pageMessages>      
                   
            <apex:pageBlockTable value="{!CampaignMembers}" var="cm">
                               <apex:column value="{!cm.LeadId}"/>
               </apex:pageBlockTable>
        </apex:pageBlock>
             
    </apex:form>  
</apex:page>

Controller

public with sharing class callCampaignController {

       private List<CampaignMember> CampaignMembers;

    public List<CampaignMember> getCampaignMembers()
    {
       return CampaignMembers;
     
    }  
         
     }
PratikPratik (Salesforce Developers) 
Hi Rajshri,

Try this:

Controller

public with sharing class callCampaignController {

       private List<CampaignMember> CampaignMembers;

    public List<CampaignMember> getCampaignMembers()
    {
       return CampaignMembers;
    
    } 
   
    }

Page:

<apex:page controller="callCampaignController">
    <apex:sectionHeader title="My Call List"></apex:sectionHeader>
    <apex:form >
        <apex:pageBlock title="">
          <!-- To show page level messages -->
          <apex:pageMessages ></apex:pageMessages>     
                  
            <apex:pageBlockTable value="{!CampaignMembers}" var="cm">
                               <apex:column value="{!cm.LeadId}"/>
               </apex:pageBlockTable>
        </apex:pageBlock>
            
    </apex:form> 
</apex:page>


Thanks,
Pratik



P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
PratikPratik (Salesforce Developers) 
Hi Rajshri,

I can see the output as:

User-added image
Naveen Rahul 3Naveen Rahul 3
Rajashri,

You must have added any field that were not presented in the object.

Thanks
Naveen
RajashriRajashri
Hi,

Hi Pratik

what changes have you done?I see the same code there

Rajashri
PratikPratik (Salesforce Developers) 
Hi Rajshri,

The code is giving error free output.  

If it's giving you the error, can you please post the screenshot of the error page.

Thanks,
Pratik
RajashriRajashri
User-added image
RajashriRajashri
Attached is the Screenshot
Sushil KaushikSushil Kaushik
Hi Rajshri,

Try 'Lead'  insted of 'LeadID' and please let me know if it is still not working.

Regrads,

Sushil
PratikPratik (Salesforce Developers) 
Hi Rajshri,

Here are the screenshots:

User-added image


User-added image

Try these and post if you getting issues.

Thanks,
Pratik
RajashriRajashri
Thanks Guys!

I tried "Lead" also but i am still getting an errors.

Rajashri
Naveen Rahul 3Naveen Rahul 3
Rajashri,

go to that object and see wheather that flied is available or try use default ID.

Thanks
Naveen
RajashriRajashri
Hi Naveen

That field is present in Object then also it's giving an error Invalid Property for ID also.Any Idea?
PratikPratik (Salesforce Developers) 
Hi Rajashri,

Can you try creating the Controller Class and Page again. 

Thanks,
Pratik
RajashriRajashri
It's not working looks like there is other way to use Campaignmembers object..It's working fine for Campaign controller