I want to filter opportunities to grab specific set of campaigns in start method itself and pass the filtered list to the execute. I am thinking of not to use additional query in start method using Database.getQueryLocator since I already have the entire list coming in constructor. I am planning to use Iterable as return in start method but getting following error "Return value must be of type: Iterable"
Code:
public Iterable<sObject> start(Database.BatchableContext bc){
for(Opportunity Opp: newList){
//Filter incoming opportunities and grab campaignIds of the sccess opportunities into set "OriginalCampaignIds"
}
return OriginalCampaignIds;
}
Tried below codes:
public List<Id> start(Database.BatchableContext bc){
for(Opportunity Opp: newList){
//Filter incoming opportunities and grab campaignIds of the sccess opportunities into set "OriginalCampaignIds"
}
}
return new List<Id>(OriginalCampaignIds);
}
Error: Class must implement the global interface method: Iterable start(Database.BatchableContext) from Database.Batchable
Another Try:
public Iterable<Id> start(Database.BatchableContext bc){
for(Opportunity Opp: newList){
//Filter incoming opportunities and grab campaignIds of the sccess opportunities into set "OriginalCampaignIds"
}
return new List<Id>(OriginalCampaignIds);
}
Same error as above