You need to sign in to do that
Don't have an account?

display in the table
Hello, I am trying to get the value of the last run of each JOB and introduce a table.
I have to use another variable and not PreviousFireTime of CronTrigger because I will treat this data with other values before you present it.
Somebody help me, the code displays the date of the last JOB only.
APEX:
Result:
01/07/2014 17:00
01/07/2014 17:00
01/07/2014 17:00
Thank you!!!
I have to use another variable and not PreviousFireTime of CronTrigger because I will treat this data with other values before you present it.
Somebody help me, the code displays the date of the last JOB only.
APEX:
......... variableA = [SELECT CronJobDetail.Name, CreatedDate, State, PreviousFireTime, NextFireTime,CronExpression FROM CronTrigger where OwnerId = '00524']; public String infoLastExec{get;set;} Datetime getPlan; for(CronTrigger a: variableA){ getPlan = a.PreviousFireTime; infoLastExec = getPlan.format(); } .............Visualforce:
<apex:column headervalue="Last Executi" value="{!infoLastExec}"/>
Result:
01/07/2014 17:00
01/07/2014 17:00
01/07/2014 17:00
Thank you!!!
create a variable in finish method to capture last fire time because once complete all batches then oly enter into finish method
Are you testing batch class more than 200 records?
Can you give me an exemple?
==> Are you testing batch class more than 200 records? NON
global class batchjob implements database.batchable<sObject>{
global database.getQuerylocator start (Database.BatchableContext BC){
}
global viod execute(Database.BatchableContext BC, List<sObject> scope){
}
global void finish(Database.BatchableContext BC){
Datetime dt = datetime.now();
system.debug('the last transaction date' + dt);
}
}