Salesforce Scheduler is enabled. Users have Shift permission.
Usage
Salesforce Scheduler Recurring Shifts
Use the RecurrencePattern field to specify the recurrence pattern for recurring shifts. These recurrence patterns, called reference rules or “RRULES”, support a subset of the RFC 5545 standards. This table includes common RRULE examples.
Recurrence Pattern
RRULE Example
Every day for five days
RRULE:FREQ=DAILY;INTERVAL=1;COUNT=5
Every two weeks on Monday and Friday for 10 occurrences
RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,FR;COUNT=10
Monthly on the first day of the month until August 1, 2022
The RRULE defined by RecurrencePattern supports a subset of the RFC 5545 standard for internet calendaring and scheduling. Supported RRULE parts include FREQ, BYMONTH, BYMONTHDAY, BYDAY, BYSETPOS, INTERVAL, UNTIL, and COUNT.
When the event record is saved, the RRULE might be modified to follow the required format:
The RRULE parts are placed in the following order: FREQ, BYMONTH, BYMONTHDAY, BYDAY, BYSETPOS, INTERVAL, UNTIL, and COUNT.
Any missing default values are inserted. For example, if the RRULE doesn’t include INTERVAL, then INTERVAL=1 is added.
The RRULE is prefaced with RRULE: if that preface is missing.
RRULE Part
Supported RFC 5545 Implementation
FREQ
Required. Indicates the type of recurrence rule. Allowed values are:
DAILY— supported parts include FREQ, INTERVAL, UNTIL, and COUNT.
WEEKLY—supported parts include INTERVAL, UNTIL, COUNT, and BYDAY. BYDAY is required, but can’t be preceded by a number. For example, to indicate weekly on Tuesday and Thursday until September 1 2022, use RRULE:FREQ=WEEKLY;UNTIL=20220901T000000Z;BYDAY=TU,TH
MONTHLY—supported patterns include:
BYMONTHDAY For example, to indicate monthly on the third day of the month use: RRULE:FREQ=MONTHLY;BYMONTHDAY=3
BYDAY and BYSETPOS For example, to indicate the last weekday of the month, use RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
BYDAY, where the BYDAY values are specified with a numeric value For example, to indicate monthly on the first Friday for 10 occurrences, use RRULE:FREQ=MONTHLY;COUNT=10;BYDAY=1FR
BYMONTH
The month. Valid values are 1 to 12.
BYMONTHDAY
The day of the month. Valid values are 1 to 31. If BYMONTHDAY is 31 and the month has fewer than 31 days, the event is created on the last day of the month.
BYDAY
A comma-separated list of days of the week. Valid values are SU, MO, TU, WE, TH, FR, SA. For RRULES with monthly frequency, BYDAY must be one of:
a single day
weekend days
week days
every day of the week
Each BYDAY value can be preceded by an integer that indicates the nth occurrence of a specific day within the monthly RRULE. Allowed values are -1, 1, 2, 3, and 4. You can’t use different numbers in the BYDAY values. For example, this RRULE isn’t supported: RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU If BYDAY values are prefaced with a number, the RRULE can’t include BYSETPOS.
BYSETPOS
A comma-separated list of values that correspond to the nth occurrence within the set of recurrence instances specified by the rule. Valid values are -1, 1, 2, 3, or 4. Default value is 1. For example, to indicate the last weekday of the month, use: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
INTERVAL
The repetition interval. Valid values are:
an integer between 1 and 31 if FREQ=DAILY
an integer between 1 and 26 if FREQ=WEEKLY
an integer between 1 and 12 if FREQ=MONTHLY
Default value is 1.
UNTIL
Specifies the datetime in UTC format when the recurrence rule stops. The supported format is yyyyMMddTHHmmssZ, for example: 20210419T083000Z. An RRULE can’t contain both UNTIL and COUNT. A recurring event without either UNTIL or COUNT leads to an error.
COUNT
The number of occurrences. Allowed values are 1–120. An RRULE can’t contain both UNTIL and COUNT. A recurring event without either UNTIL or COUNT leads to an error.
Description: Sets a background color for shifts shown in the UI. Use a 3- or 6-digit hexadecimal format. For example, #FF00FF. Available in API version 55.0 and later.
EndTime
Type: dateTime
Properties: Create, Filter, Sort, Update
Description: The date and time that the shift ends.
Description: The date and time when the current user last viewed a related record.
LastViewedDate
Type: dateTime
Properties: Filter, Nillable, Sort
Description: The date and time when the current user last viewed this record.
OwnerId
Type: reference
Properties: Create, Defaulted on create, Filter, Group, Sort, Update
Description: The owner of the shift. This is a polymorphic relationship field.
Relationship Name: Owner
Relationship Type: Lookup
Refers To: Group, User
RecurrenceEndDate
Type: date
Properties: Create, Group, Nillable, Sort, Update
Description: The date when the recurrence period ends. The date must be after the Recurrence Start Date. The value for this field is retrieved from the pattern defined in the RecurrencePattern field. You can define the end date by using the COUNT or UNTIL parameter in the RecurrencePattern field. If you specify a value in this field and define a recurrence pattern, Salesforce Scheduler overrides the value with the end date in the recurrence pattern. The recurrence period is limited to 180 days. This field is available in API version 56.0 and later.
RecurrencePattern
Type: string
Properties: Create, Group, Nillable, Sort, Update
Description: The RRULE that describes the recurrence pattern for recurring shifts. Supports a subset of the RFC 5545 standard for internet calendaring and scheduling. See the Salesforce Scheduler Recurring Shifts section in this topic for usage examples. The period for the recurrence pattern is limited to 180 days. This field is available in API version 56.0 and later.
RecurrenceStartDate
Type: date
Properties: Create, Group, Nillable, Sort, Update
Description: The date when the recurrence period begins. The date must be before the Recurrence End Date. The value for this field is retrieved from the StartTime field. Don’t modify the value for this field. This field is available in API version 56.0 and later.