You need to sign in to do that
Don't have an account?
Ritesh__
Execution Confusion in Batch class Apex
i am calling a batch class instance and after completing batch class i am calling two other batch class instance. finish() method code for first batch class is
public void finish(Database.BatchableContext BC){ List<Event__c> events =[SELECT Id from Event__c]; delete events; System.debug('Executing finish'); for(CalendarSettings__c c: [Select Id, Name, CalendarId__c,CalendarQuery__c,FieldToDisplay__c from CalendarSettings__c]) {System.debug('Calendar Id is'+c.CalendarId__c); BatchPublicCampaignsToGoogle bjob = new BatchPublicCampaignsToGoogle(c.CalendarQuery__c,c.CalendarId__c,c.FieldToDisplay__c); Database.executeBatch(bjob,9); } }
the problem i am facing is i am expecting that Batch class BatchPublicCampaignsToGoogle will be called two times but it is called only one time and loop is running for two times (i analysed debug log ).why it is called only one time please some one explain??