I can't think how to write a query to return all the contacts and all the leads (IDs, Names, and Phones) from CampaignMember.
I've never used much else rather than the standard [SELECT field FROM object WHERE criteria] format so I don't really know where to start.
At the start of the function I have the Id of the campaign, and two empty lists of Contact and Lead, which I'd like to populate. Can anyone help?
Best Answer
You should be able to do something like: