You need to sign in to do that
Don't have an account?
thekid12345
Is there any way to call a class that is already created and reference it in a batch class so that the class is ran on a nightly basis?
For Example, below is my class that I want to reference in the batch class. Is there a way where I can schedule the class called Test and reference it in the Batch class?
public class Test{ //Code to do updates }
global class ExampleBatchClass implements Database.Batchable<sObject>{ global ExampleBatchClass(){ // Batch Constructor } // Start Method global Database.QueryLocator start(Database.BatchableContext BC){ return Database.getQueryLocator(query); } // Execute Logic global void execute(Database.BatchableContext BC, List<sObject>scope){ // Logic to be Executed batch wise } global void finish(Database.BatchableContext BC){ // Logic to be Executed at finish } }
Raj Vakati
Yes .. Please find the pseudo code here
thekid12345
What happens if there are multiple queries in my class? How do I reference them in the batch class?
Raj Vakati
You can define the different methods or constructor to accept those queries
thekid12345
Can you show an example, please?