I execute the following in the anonymous execution:
Database.executeBatch(new TransferACDCAccountOppOwnerBatch(), 200);
The class is below. It uses Batchable interface. I put in a bunch of debug statements but don't see anything in the logs in the console. I also create debug logs at Debug level for Apex, etc. and also don't see any of the system.debug output. The SOQL itself I know works and should only return one row in the developer sandbox test data I setup.
Is there something about the batchable interface that doesn't allow system.debug output? I know it's asynchronous, but the job completes and I see plenty of log information. I just don't see any system.debug output.
global class TransferACDCAccountOppOwnerBatch implements Database.Batchable<sObject> {
String query;
static String type = 'Accountant';
static String stageName = 'Closed Won';
static String numberEmployees = '<5';
global TransferACDCAccountOppOwnerBatch() {
query = 'SELECT Id, Num_Active_Orgs__c, Num_Active_Paying_Orgs__c,Number_of_Bookkeeping_Clients__c, Number_Bookkeeping_Clients_SR__c,' +
'Num_Targeted_Orgs__c, AccountId, Account_State__c, Biz_Dev_Owner__c,CloseDate, IsClosed, Name, Type, OPS_ID__c, Org_Creator__c,' +
'Org_s_Geographical_State__c, OwnerId, StageName, Tier__c, IsWon,First_targeted_Org__r.NumberEmployees__c, Account.name, Account.owner.name' +
' FROM Opportunity' +
' WHERE StageName = :stageName' +
' And type = :type' +
' And CloseDate < Last_90_Days' +
' And First_targeted_Org__r.NumberEmployees__c = :numberEmployees';
}
global Database.QueryLocator start(Database.BatchableContext BC) {
System.debug('start query');
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<Account> scope) {
System.debug('execute batch transfer');
TransferACDCAccountOppOwnerHandler hierarchy_handler = new TransferACDCAccountOppOwnerHandler();
hierarchy_handler.setup(scope, BC.getJobId());
System.debug('after hierarchy handler setup');
// hierarchy_handler.runMatching();
// hierarchy_handler.processConsoles();
// hierarchy_handler.processGlobalConsoles();
// hierarchy_handler.commitUpdates();
}
global void finish(Database.BatchableContext BC) {
System.debug('finish bath');
}
}