How to create a schedule job in Salesforce to periodically trigger the corresponding class

Source: Internet
Author: User

In the Salesforce also exists the concept of job, of course, we can create a schedule job to trigger the corresponding class, to complete the time we need to process the function, such as: Timed synchronization data.

The specific processing steps are as follows:

1: The created class needs to inherit the Schedulable interface and implement the corresponding Execute method, which can complete our own code logic in the Execute method

Global class Syncstorecontroller implements schedulable {
    //call the Web service to get the store info
    global void Execute (schedulablecontext SC) {
      system.debug ('---------001 hahaha. I am Sync store controller. ');
          
      To do-complete your logic
   }
}

2): To the Apex classes in Salesforce find the Schedule Apex button

3): Click on the Schedule Apex button in the above image to fill in the necessary information in the displayed interface

"Job name and Apex class, click on the search box to filter out the Class that has access and inherits the Schedulable interface."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.