in salesforce how to run batch from develop console and schedule job apex job

来源:互联网 发布:气象局和环保局知乎 编辑:程序博客网 时间:2024/05/22 13:52

登陆到salesforce ,然后点击developer console 进入。

然后输入

Id <variable name>= Database.execute(new <Class name>(), batch size);Id batjobId = Database.execute(new RunThisBatch(), 200);

注意是类需要初始化。

可以在set->develop->apex classes->schedule apex 中添加apex class 设置执行时间段等。

当然batch在运行的时候,会在moniting->apex jobs 中查看到batch的执行情况。

可以在 moniting ->schedule jobs 中管理需要定时运行的batch

  小提示:如果第一次增加 schedule apex的时候没有成功,可以去修改一下需要增加的apex class,然后保存。目的就是为了更新一下这个apex class的时间,避过系统的检测。

                这样就可以正常添加了。


0 0
原创粉丝点击