Account Batch Details
Account Batch Class And Query.
Batch Class Name - BatchRunAccountOFAC (Managed Package)
Schedulable Class - ScheduleBatchRunAccountOFAC (Managed Package)
Steps to Run Account Batch
Stop the existing Scheduled Batch from Scheduled Jobs - ‘OFAC Batch Account 2000’
Change the Query and Schedule the Batch as below
creditchecker.ScheduleBatchRunAccountOFAC oScheduleBatchRunAccountOFAC = new creditchecker.ScheduleBatchRunAccountOFAC();
String query = 'Select Id,Customer_Status__c,Do_Not_Run_OFAC__c,Name,Type,Number_of_Opportunities__c From Account Where (Customer_Status__c != \'Prospect-Dead\' OR Type IN (\'Prospect\',\'Customer,Partner\',\'Other\',\'Cloud Customer\',\'Partner Prospect\')) AND Do_Not_Run_OFAC__c = FALSE AND Number_of_Opportunities__c != 0 AND Last_OFAC_Search_Performed__c = null LIMIT 2000';
oScheduleBatchRunAccountOFAC.query = query;
System.schedule('OFAC Batch Account 2000', '0 0 22 * * ? *', oScheduleBatchRunAccountOFAC);
Here '0 0 22 * * ? *' is the time at which the job will be scheduled. Currently the job is scheduled at 10 PM in the night.
Contact Batch Details
Contact Batch Class And Query.
Batch Class Name - BatchRunContactOFAC (Managed Package)
Schedulable Class - ScheduleBatchRunContactOFAC (Managed Package)
Steps to Run Contact Batch
Stop the existing Scheduled Batch from Scheduled Jobs - ‘OFAC Batch Contact 2000’
Change the Query and Schedule the Batch as below
creditchecker.ScheduleBatchRunContactOFAC oScheduleBatchRunContactOFAC = new .creditchecker.ScheduleBatchRunContactOFAC();
String query = 'Select Id,FirstName,LastName,Name,Account.Name,CreatedDate,RecordTypeId,FCRM__FCR_Status__c, Account_Customer_Status__c From Contact Where FCRM__FCR_Status__c NOT IN(\'Closed - Rejected\',\'Closed - Not Active With Sales\',\'No Longer at Company\') AND (Account.Name != \'Test Prospect Americas\' OR Account.Name != \'Test Prospect EMEA\' OR Account.Name != \'MDB\') AND Account_Customer_Status__c != \'Prospect-Dead\' AND LastName != \'[not provided]\' AND RecordType.DeveloperName = \'MongoDB_Contact\' AND Do_Not_Run_OFAC__c = False AND Last_OFAC_Performed__c = null LIMIT 2000';
ScheduleBatchRunContactOFAC.query = query;
System.schedule('OFAC Batch Contact 2000','0 0 2 * * ?', oScheduleBatchRunContactOFAC);
Here '0 0 2 * * ? *' is the time at which the job will be scheduled. Currently, the job is scheduled at 2 AM in the night.