What is a Campaign? One of the most underutilized tools in the Salesforce toolbox is the campaign. A campaign functions almost like a folder or…
//First Step to create a new campaign and Insert it Campaign cm = new Campaign(name='Any Name', isactive=true); insert cm; //Now Create a new lead and Insert it lead l = new lead(lastname='new lead test',company='new'); insert l; // Now we have to create a campaign member which will connect campaign and lead together and insert the campaignmember campaignmember mem = new campaignmember(campaignid = cm.id,leadid = l.id); insert mem;Check out another amazing blog by Ashish here: Lightning App Manager in Salesforce - All you Need to Know
There was a problem reporting this post.
Please confirm you want to block this member.
You will no longer be able to:
Please note: This action will also remove this member from your connections and send a report to the site admin. Please allow a few minutes for this process to complete.