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
Surya PSurya P 

Leads Assigning to Campaigns as Campaign Members programmatically.

Hi Team,

I'm new to Salesforce. I have a question regarding assigning leads to campaigns.
I came across this use case where I need to fetch all the lead records from leads object (based on certain criteria: eg say not assigned to campaign) and from this list of records i need to create new campaigns and assign only 200 lead records to each campaign as campaign members and this process should continue till all the records in the list are assigned. So could you kindly help me with the code for this scenario.

Thanks in advance.

Cheers,
Surya