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
IoniaCorpIoniaCorp 

Programmatically Add Campaign to the Lead and the Contact

I have a requirement to add campaign history to the existing Lead. I want to create a new lead, if there is a lead/contact with the same e-mail I want to mark this new lead as DUPLICATE and want to update existing Lead/Contact  with the new Campaign and the other new field values.
Any clue will be appreciated.
IoniaCorpIoniaCorp
I found out the solution by using CampaignMember.
Thanks.
MeikoMeiko
What is CampaignMember?
 
Thanks
IoniaCorpIoniaCorp
CampaignMember is an object that has relationship with the object Campaign.