Activity Forums Salesforce® Discussions How to use CRON expression in Batch Class in Salesforce?

  • Shweta

    Member
    June 8, 2020 at 2:40 pm

    In Scheduler class, we can execute at a specified time. What we are trying to do is Schedule a Batch. E.g.:
    SendEmailToAccountAndContactBatch schedulable = new SendEmailToAccountAndContactBatch();
    String sch = '0 0 13 ? MON,TUE,WED,THU,FRI ';
    system.schedule('SendEmailToAccountAndContactBatch', sch, schedulable);
    database.executebatch(schedulable);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos