Activity Forums Salesforce® Discussions What is the use of scheduler class in Salesforce?

  • Rabn

    Member
    February 8, 2020 at 3:50 am

    Scheduler class is basically an apex class or a batch class which you want to run it at certain point of time.

    Suppose you want to send an mass email to all your contacts on the end of every month. In that case you can schedule a class which will automatically send the emails on every month end.

    For scheduling an apex class, you can do the following

    From Setup, enter Apex Classes in the Quick Find box, select Apex Classes, and then click Schedule Apex.
    Specify the name of a class that you want to schedule.
    Specify how often the Apex class is to run.For Weekly—specify one or more days of the week the job is to run (such as Monday and Wednesday).
    For Monthly—specify either the date the job is to run or the day (such as the second Saturday of every month.)

  • Arun

    Member
    February 10, 2020 at 12:21 pm

    Hi Pooja ,

    When you want to run a piece apex code at some particular time within a period of time.Schedule apex is class which runs at a regular interval of time. To schedule an apex class we need to implement an interface Schedulable. If you want to run a piece to schedule code at the first of every month or day wise  you can use to make your life easier when you have to redeploy/change this code Scheduler apex runs as system mode that means whether the user has permission to execute the class or not, they can execute  the class.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos