+ Start a Discussion
SFDC_DeveloperSFDC_Developer 

How to get Campaign member status Value based on Campaign

I have created one vf page which will show list of Campaign member based on particular condition in page block. In each campaign member I have one status field which I need to update. The Campaign member status values are depended on each and every Campaign which is parent of Campaign member. As of now I am getting all status value. I want to know how I can display relevant status value for each campaign member. below is my query:
 
List<CampaignMember> = [Select Contact.firstname,Campaign.name,campaign.status,
                         Contact.lastname,status
                         FROM CampaignMember LIMIT 1000];

 
pconpcon
You don't really give us much information to go to here.  Are you trying to show related CampaignMembers?  If so, you can restrict it by using the CampaignId field.
 
List<CampainMember> members = [
    select Campaign.Name
    from CampainMember
    where CampainId = :id and
        Status = 'My Status'
];