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

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.status,
                         FROM CampaignMember LIMIT 1000];

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'