Reporting API Documentation

ffr.CronSpec

global class CronSpec

This class is used to represent a cron expression. Read http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm and http://en.wikipedia.org/wiki/Cron. New crons can be generated from scratch, or can be generated from a given cron string. Each cron will be of a given type, known as a frequency type, e.g Hourly, daily, weekly.

Date

2014

Methods

createHourlyCron

global static ffr.CronSpec createHourlyCron(String interval, String offset)

Create a ffr.CronSpec with an hourly schedule.

Input Parameters

Name Type Description
interval String The interval at which you want the schedule to run. For example if you select 3 hours the schedule runs every 3 hours. The limit is 12 hours.
offset String The minutes past the hour that you want the schedule to run; 00, 15, 30 or 45.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createDailyCron

global static ffr.CronSpec createDailyCron(String hour)

Create a ffr.CronSpec with a daily schedule.

Input Parameters

Name Type Description
hour String The hour of the day to run the schedule on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createWeeklyCron

global static ffr.CronSpec createWeeklyCron(String hour, String[] weekDays)

Create a ffr.CronSpec with a weekly schedule.

Input Parameters

Name Type Description
hour String The hour of the day to run the schedule on.
weekDays String[] The days of the week you want the schedule to run. For example, 1 for Sunday, 2 for Monday and so on. Enter more than one string in the array to choose multiple days.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createMonthlyByDayOfTheMonthCron

global static ffr.CronSpec createMonthlyByDayOfTheMonthCron(String hour, String monthDay)

Create a ffr.CronSpec with a monthly schedule via a specific day of the month.

Input Parameters

Name Type Description
hour String The hour of the day to run the schedule on.
monthDay String The day of the month to run the schedule on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createMonthlyByDayOfTheWeekCron

global static ffr.CronSpec createMonthlyByDayOfTheWeekCron(String hour, String dayOccurrence, String weekday)

Create a ffr.CronSpec with a monthly schedule via a specific week day.

Input Parameters

Name Type Description
hour String The hour of the day to run the schedule on.
dayOccurrence String The selected day to run the schedule on. For example, if weekDay is Tuesday then giving dayOccurance a value of 2 will make the schedule run on the second Tuesday of the month. Choice of 1 to 4, and 'L' for last occurrence of the month.
weekday String The day of the week to run the schedule on. For example, 1 for Sunday, 2 for Monday and so on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createByDate

global static ffr.CronSpec createByDate(String seconds, String minutes, String hour, String monthDay, String month, String year)

Create a ffr.CronSpec to schedule on a specific date.

Input Parameters

Name Type Description
seconds String The seconds to run the schedule on.
minutes String The minutes to run the schedule on.
hour String The hour of the day to run the schedule on.
monthDay String The day of the month to run the schedule on.
month String The month to run the schedule on.
year String The year to run the schedule on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createByDate

global static ffr.CronSpec createByDate(String seconds, String minutes, String hour, Date theDate)

Create a ffr.CronSpec to schedule on a specific date.

Input Parameters

Name Type Description
seconds String The seconds to run the schedule on.
minutes String The minutes to run the schedule on.
hour String The hour of the day to run the schedule on.
theDate Date The date to run the schedule on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

createByDate

global static ffr.CronSpec createByDate(Datetime theDate)

Create a ffr.CronSpec to schedule on a specific date.

Input Parameters

Name Type Description
theDate Datetime The datetime to run the schedule on.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

parse

global static ffr.CronSpec parse(String cronString)

Parse the given cron string into a ffr.CronSpec

Input Parameters

Name Type Description
cronString String The cron expression to create a CronSpec object from.

Return Value

This method returns a CronSpec object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code
© Copyright 2009–2019 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.