Setting up a batch to update report data

The Async Reporting process uses a regular batch process to extract vacation absence data from your org. The reporting process does not display any data - Tile and Detail views are empty - until the batch has run for the first time.

Sage People also recommends that you run the batch to update data after installing an updated Async Reporting package.

To set up the batch:

  1. Go to the Apex Classes page: 

    • In Salesforce Lightning Experience, go to Setup > Platform Tools > Custom Code > Apex Classes.

    • In Salesforce Classic interface, go to Setup > App Setup > Develop > Apex Classes.

  2. Select Schedule Apex:

    Screenshot: Selecting the Schedule Apex button

  3. On the Schedule Apex page, complete the fields as follows:

    Field Description
    Job Name A meaningful name for the batch process, such as Absence Reporting.
    Apex Class The Apex Class that runs the batch job. Select Apex Class Lookup Icon: Salesforce lookup and select the AsyncReportingAbsenceSchedule Apex Class.
    Frequency

    When the batch is to run. Select from:

    • Weekly

      Select the day of the week. To run on more than one day every week, select the days you want the batch to run.

      To run more than one batch on a given day, set up separate batches with your desired combinations of day of the week and Preferred Start Time; for example, one batch on Monday at 8:00 AM, one batch on Monday at 9:00 AM.

    • Monthly

      Select from:

      • The day of the month - 1, 2, 3...

      • The nth occurrence of a particular day; for example, the third Monday of every month.

    Start

    The date you want the first batch to run. If you set Start to today's date and you want the batch to run today, make sure Preferred Start Time is later than the current time.

    End

    The date you want the batch to stop running.

    Preferred Start Time

    Picklist. Select the picklist and choose the time of day you want the batch to run. Batches may run after the Preferred Start Time if the job queue is busy at the time.

  4. Select Save.

  5. Check the batch is scheduled to run when you expect it:

    1. Go to the Schedule Jobs page: 

      In Salesforce Lightning Experience, go to Setup > Platform Tools > Environments > Jobs > Scheduled Jobs.

      In Salesforce Classic interface, go to Setup > Administration Setup > Monitoring > Scheduled Jobs.

    2. Check the Next Scheduled Run value for the new batch job.

You cannot amend batch details after you have saved. You need to delete and recreate to make changes.

Note

Each time the batch runs, data is written to an Async Report Run record with data for each Team Member held in an Async Report Row object. You can inspect the data in JSON (JavaScript Object Notation) format for a Team Member by going to the Team Member Detail page and scrolling down to the Async Report Rows Related List. The Async Report Rows Related List is not displayed by default and must be added to the page layout.