I am new to salesforce developing. I want to build an component that shows details related to a contact owner of a campaign member. How can I do it?
1 Answer
First you should know how Campaign is related to Cotnact or Lead. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_majors.htm
Also depending on which object do you want to show this info you should laverage the Campaign Member object. Here is an example query starting from Campaign. You do not mention if you want to use APEX or NOT. Or you want to make this only using declarative tool. Nevertheless I think you can find this info helpfull to understand how to accomplish your goal.
SELECT Id, Owner.FirstName, Owner.FirstName
FROM Contact
WHERE Id IN (SELECT ContactId FROM CampaignMembers WHERE CampaignId = :CampaignId)
Tell me if this would do the job, if not please give me more info so that I can give you more accurate answer.