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

API to Campaign object's CampaignMemberRecordType field
Campaign object's now have a CampaignMemberRecordType field which is the record type to create CampaignMember records with.
Unfortunately, I can't set it in Apex code. Eclipse complains with "Invalid field CampaignMemberRecordType for SObject Campaign".
I also tried using CampaignMemberType, but also got an Eclipse error.
What do I need to do to be able to set this programmatically?
Thanks,
Dave
Ah - sorry for the "is your computer plugged in" response.
You're using the wrong field name. You need to use:
CampaignMemberRecordTypeId
All Answers
Hi David - the Campiagn Member Type field on the Campaign Page Layout is actually pointing to Campaign Member Object record types.
You can create Campaign Member record types using the API to populate this field.
The reason we implemented it this way is so that all members of a campaign will have the same type, so you only have to set the value once regardless of how many times you add people to a campaign. It simplifies the clicks quite a bit and works for 95% of the use cases.
I understand what the field is for. What I need to do is when I create a Campaign from the API, I also want to set what the record type should be for CampaignMembers that will get created on that Campaign. Unfortunately, the field Campaign.CampaignMemberRecordType does not seem to be available from the API and thus my Apex code won't compile.
What do I need to do to make it available in Eclipse?
Thanks,
Dave
Ah - sorry for the "is your computer plugged in" response.
You're using the wrong field name. You need to use:
CampaignMemberRecordTypeId
Thanks!
Dave