Created
June 26, 2023 23:33
-
-
Save forcethesales/73f8dcf589e77e1169d5256068566a08 to your computer and use it in GitHub Desktop.
quickly add new campaign member status to all campaigns of Type Email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Campaign> exampleTwo = new List<Campaign>([SELECT Id, Name FROM Campaign WHERE Type = 'Email']); | |
List <CampaignMemberStatus> newStati = new List <CampaignMemberStatus> (); | |
for (Campaign camp : exampleTwo) { | |
CampaignMemberStatus newStat = new CampaignMemberStatus(); | |
newStat.CampaignID = camp.Id; | |
newStat.Label= 'Subscribed'; | |
newStati.add(newStat); | |
} | |
insert newStati; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment