You need to sign in to do that
Don't have an account?

CampaignMemberRecordType
Hey
I have a custom VF button in my Campaign Detail page. This button queries the Campaign members and generates a pdf document (list of members and there submissions).
Depending on the campaign member record type selected, i want to generate a different list - Survey, Webcast etc etc.
How do I pass the CampaignMemberRecordTypeId from campaign detail page to the VF page?
Doing Campaign cap = [select Id, CampaignMemberRecordTypeId from Campaign where id = :campid];
only gives an error saying "CampaignMemberRecordTypeID" - No such Column?
Also, I need to be able to compare the above campaignmemberrecordtypeid with the specified record type ids for campaign member. So I did this
Schema.SObjectType.CampaignMember.getRecordTypeInfosByName().get('Survey').getRecordTypeId()
only to get null. What am I doing wrong?
-VJ
The campaign members have references to the parent campaign rather than the other way around.
Thus if you want to get the record type (or types?) for the campaign, you'll need something like:
List<CampaignMember> cmList=[select id, RecordTypeId from CampaignMember where CampaignId=:campid];
The field name on Campaign is:
CampaignMemberRecordType
Not
CampaignMemberRecordTypeID
Not sure the problem on the getRecordTypeID() - perhaps case sensitive?