You need to sign in to do that
Don't have an account?
INDY ONE
Could some one help with:
Using batch Create a scheduler which will run midnight daily. The scheduler will check for duplicate Accounts and if find any then it will merge the accounts and relate its child records(Contacts,Opportunity and Cases) to the one which is existing.
At schedular class you cannot write a SOQL query and execute, It has to be written at Batch start method.
To schedule a class at midnight daily GOTO -> setup -> Schedule apex -> select all days and time and schedule it.
or use below scheduler class
public class scheduleBatchclass implements Schedulable {
public string scheduleFamBatchclass2() {
scheduleBatchclass reminder = new scheduleBatchclass();
String sch = '0 0 24 1/1 * ? *';
return System.schedule('execute batch class', sch, reminder);
}
public void execute(SchedulableContext sc) {
BatchClass b = new FBatchClass();
database.executebatch(b);
}
}
if it helps mark as best answer.
Thanks,
Mukul