this is my apex class for scheduling to run every 30 min.but when i scheduled in salesforce it will run after one hour but i need to run my scheduled class for every 30 mins.anyone help me to gohead
this is my scheduled class :
global class SchedulingService implements Schedulable {
global void execute(SchedulableContext SC){
ServiceNowUpsert.GetIncident('xxxxx','xxxxx','xxxxx');
String day = string.valueOf(system.now().day());
String month = string.valueOf(system.now().month());
String hour = string.valueOf(system.now().hour());
String minute = string.valueOf(system.now().minute() + 30);
String second = string.valueOf(system.now().second());
String year = string.valueOf(system.now().year());
String strJobName = 'Job-' + second + '_' + minute + '_' + hour + '_' + day + '_' + month + '_' + year;
String strSchedule = '0 ' + minute + ' ' + hour + ' ' + day + ' ' + month + ' ?' + ' ' + year;
System.schedule(strJobName, strSchedule, new SchedulingService());
}
}
Thanks
0 0 0 * * ?
and0 0 30 * * ?
) your jobs will always run and never require a manual restart.