标签:cap 异步 pex run 并且 yun rem class batch
类似于Windows Schedule Job;
有两种方式的用法:
直接上代码:
①:
public class AccountSchedula implements Schedulable {
public void execute(SchedulableContext sc) {
System.debug(‘ceshi schedula‘);
}
}
测试:@isTest
public class TestAccountSchedule {
static testMethod void myUnitTest() {
String executeTime = ‘0 0 16 * * ?‘;
AccountSchedula goodsSchedule = new AccountSchedula();
System.schedule(‘batch goods‘,executeTime,goodsSchedule);
}
}
直接run test 便可以看到Log 上的debug信息
②:
global class dldcApprovalofTimecardScheduled implements Schedulable {
global static void execute(SchedulableContext sc) {
dldc_Timecard_Approval_Reminder.Approval();
}
}
global class dldc_Timecard_Approval_Reminder{
global static void Approval() {
}
}
在Apex class 中找到dldcApprovalofTimecardScheduled 并且点击schedula ,在页面上上就可以设置执行的时间,不过都是半点或者是整点,看个人喜好选择这两种方式
标签:cap 异步 pex run 并且 yun rem class batch
原文地址:http://www.cnblogs.com/bandariFang/p/6484704.html