AsyncApexJob a = [SELECT Id, Status, NumberOfErrors, JobItemsProcessed,
TotalJobItems, CreatedBy.Email
FROM AsyncApexJob WHERE Id =:BC.getJobId()];
* Above syntax is to retrieve information regarding to the jobs.
Batch_classname bs = new Batch_classname();
Datetime sysTime = System.now();
sysTime = sysTime.addminutes(6);
String chron_exp = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' +
sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();
System.schedule('Update Actual'+sysTime.getTime(),chron_exp, bs);
TotalJobItems, CreatedBy.Email
FROM AsyncApexJob WHERE Id =:BC.getJobId()];
* Above syntax is to retrieve information regarding to the jobs.
Batch_classname bs = new Batch_classname();
Datetime sysTime = System.now();
sysTime = sysTime.addminutes(6);
String chron_exp = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' +
sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();
System.schedule('Update Actual'+sysTime.getTime(),chron_exp, bs);
Use as below which is simple -
ReplyDeletechron_exp = system.now().addMinutes(6).format('ss mm HH dd ? yyyy'');