Sometimes we need to run a class in every minute to do some operation. // This section of code will schedule the next execution 1 minutes from now global class Scheduling_Svc_WS_CreateBatch implements Schedulable{ // Execute method global void execute(SchedulableContext SC) { datetime nextScheduleTime = system.now().addMinutes(1); string minute = string.valueof(nextScheduleTime.minute()); string second = string.valueof(nextScheduleTime.second ()); string cronvalue = second+' '+minute+' 0-23 * * ?' ; string jobName = 'selfReschedulingClass ' +nextScheduleTime.format('hh:mm'); Scheduling_Svc_WS_CreateBatch p = new Scheduling_Svc_WS_CreateBatch(); system.schedule(jobName, cronvalu...
A place where you have to land for exploring Salesforce