liuyan
2022-11-30 6b05e5c975c7e33b09e6073f1ec8419e1f9b065b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
global with sharing class DeleteOldDataSchedule implements Schedulable {
    global final Boolean isTest;
 
    /**
     * コンスタント、パラメータを受け取る
     */
    global DeleteOldDataSchedule() {
        this.isTest = false;
    }
 
    /**
     * コンスタント、パラメータを受け取る(unitテスト用)
     */
    global DeleteOldDataSchedule(Boolean isTest) {
        this.isTest = isTest;
    }
 
    global void execute(SchedulableContext SC) {
        // バッチ実行
        Id execBTId = Database.executeBatch(new DeleteOldDataBatch(isTest), 2000);
    }
}