I am trying to run an apex class daily using System.schedule but It is not showing up in scheduled jobs nor I am able to query from Cron trigger on owner Id as my Id This is the piece of code. Note : - I need to run my apex class everyday
global class scheduledDeactivation implements Schedulable {
public static String sch = '0 0 12 1/1 12 ? 2022';
global void execute(SchedulableContext SC) {
deactivateUsers usrs = new deactivateUsers();
String jobID = System.schedule('Deactivate Inactive Users', sch, usrs);
System.debug(jobId);
}
}
execute
method. That's what's supposed to happen once you hit the scheduled time and actually want to run your logic. You execute the job, or carry out the functionality you intend to run at the ordained time.