Apex Class
global class AccountHandler implements Schedulable {
global void execute(SchedulableContext ctx) {
List <Account> acListforUpdate = new List <Account>();
List <Account> acList = [SELECT Id, Type from Account];
for(Account ac : acList){
if(ac.Type == null){
ac.Type = 'Prospect';
acListforUpdate.add(ac);
}
}
if(!acListforUpdate.isEmpty()){
try{
update acListforUpdate;
}catch(Exception e) {
System.debug('An exception occurred: ' + e.getMessage());
}
}
}
}
Apex Code
Scheduling for 00 minutes
System.schedule('Update Accounts: ', '0 0 * * * ?', new AccountHandler());
You can also create an object and schedule your job:
AccountHandler reminder = new AccountHandler();
System.schedule('Update Accounts', '0 0 * * * ?',reminder);
Video
Video does not exists.