public List
public void doStart(){
System.schedule('ScheduledApex','0 0 0 3 9 ? 2022', new Cron());
}
public void doRefresh(){
results = [SELECT id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger];
}
global void execute(SchedulableContext ctx) {
System.debug('This is cron log.');
}
}
----------------------------
<apex:page controller="Cron">
<apex:form
>
<apex:commandButton value="Start"
action="{!doStart}"/><br/>
<apex:commandButton
value="Refresh" action="{!doRefresh}"/>
<apex:pageBlock
title="Cron Trigger" id="theCronTrigger">
<apex:pageBlockTable value="{!results}" var="r"
rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!r.id}"/>
<apex:column
value="{!r.CronExpression}"/>
<apex:column
value="{!r.TimesTriggered}"/>
<apex:column value="{!r.NextFireTime}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
0 件のコメント:
コメントを投稿