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.
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
1
2
3
4
5
//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
global static c2g.CronSpec createMonthlyByDayOfTheWeekCron(String hour, String dayOccurrence, String weekday)
Create a c2g.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
1
2
3
4
5
//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