Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global class UpdateEventScore implements Database.Batchable<sObject> {
- global Database.QueryLocator start(Database.BatchableContext bc) {
- // collect the batches of records or objects to be passed to execute
- return Database.getQueryLocator(
- 'Select Contact.Account.ID' +
- 'from CampaignMember' +
- 'WHERE Campaign.StartDate = LAST_N_DAYS:365' +
- 'AND status = 'Attended' ORDER BY Campaign.StartDate'
- )
- }
- global void execute(Database.BatchableContext bc, List<P> records){
- // process each batch of records
- }
- global void finish(Database.BatchableContext bc){
- // execute any post-processing operations
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement