You need to sign in to do that
Don't have an account?
My First test class for Batch class
public class PL_FIAutoAllocationCounterResetBatch implements Database.Batchable<sObject> {
public Database.QueryLocator start(Database.BatchableContext BC){
String query = 'SELECT id, Count__c FROM Sales_To_CPA_Allocation_Rule1__c WHERE Count__c !=0';
return Database.getQueryLocator(query);
}
public void execute(Database.BatchableContext BC, List<Sales_To_CPA_Allocation_Rule1__c> scope){
List<Sales_To_CPA_Allocation_Rule1__c> lstRulesToUpdate = new List<Sales_To_CPA_Allocation_Rule1__c>();
for(Sales_To_CPA_Allocation_Rule1__c rule : scope){
rule.Count__c = 0;
lstRulesToUpdate.add(rule);
}
if(lstRulesToUpdate.size() > 0){
update lstRulesToUpdate;
}
}
public void finish(Database.BatchableContext BC){
}
}
Please help me.
Try Below Test Class Please mark It As Best Answer If It Helps Thank You!
All Answers
Try Below Test Class Please mark It As Best Answer If It Helps Thank You!