Newer Version Available

This content describes an older version of this product. View Latest

SchedulingRule

Represents a scheduling rule in Workforce Engagement Management. Scheduling rules determine when agents are assigned to shifts.

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

SchedulingRule components have the suffix .schedulingRule and are stored in the SchedulingRules folder.

Version

SchedulingRule components are available in API version 53.0 and later.

Special Access Rules

This type is available only if Workforce Engagement is enabled in your org. To view, create, edit, and delete records, the user requires the Workforce Engagement Planner permission set.

Fields

Field Name Description
isProtected
Field Type
boolean
Description
Indicates whether the component is protected (true) or not (false). The default value is false.
masterLabel
Field Type
string
Description
Required. The name of the rule.
schedulingCategory
Field Type
SchedulingCategory (enumeration of type string)
Description
Required. What the scheduling logic applies the rule to. The valid values are:
  • A—Service Appointment
  • B—Shift
schedulingRuleParameters
Field Type
SchedulingRuleParameter[]
Description
Parameters associated with a scheduling rule, such as work limits.
schedulingRuleType
Field Type
SchedulingRuleType (enumeration of type string)
Description
Required. Specifies the type of rule. The valid values are:
  • A—Active Resources
  • B—Match Skills
  • C—Availability
  • M—Match Territory
  • Q—Match Queue
  • R—Rest Time
  • W—Work Limit
  • LimitNonstandardShifts—Specifies a rule type that limits how many non-standard shifts can be assigned to each agent. This type is available in API version 54.0 and later.

SchedulingRuleParameter

Represents a scheduling rule parameter, such as a work limit, that’s associated with a scheduling rule.

Field Name Description
schedulingParameterKey
Field Type
SchedulingParameterKey (enumeration of type string)
Description
Required. The scheduling rule parameter key.
  • C—Constraint Field Name
  • L—Limit Type
  • R—Resolution
  • T—Time Resolution
  • W—Work Unit
value
Field Type
string
Description
The scheduling rule parameter value.

Declarative Metadata Sample Definition

The following is an example of a SchedulingRule component.

1<?xml version="1.0" encoding="UTF-8"?>
2<SchedulingRule xmlns="http://soap.sforce.com/2006/04/metadata">
3    <masterLabel>Max Shifts Per Week</masterLabel>
4    <schedulingCategory>B</schedulingCategory>
5    <schedulingRuleParameters>
6        <schedulingParameterKey>C</schedulingParameterKey>
7        <value>MaxShiftsPerWeek</value>
8    </schedulingRuleParameters>
9    <schedulingRuleParameters>
10        <schedulingParameterKey>W</schedulingParameterKey>
11        <value>Shifts</value>
12    </schedulingRuleParameters>
13    <schedulingRuleParameters>
14        <schedulingParameterKey>R</schedulingParameterKey>
15        <value>Week</value>
16    </schedulingRuleParameters>
17    <schedulingRuleParameters>
18        <schedulingParameterKey>L</schedulingParameterKey>
19        <value>Max</value>
20    </schedulingRuleParameters>
21    <schedulingRuleType>W</schedulingRuleType>
22</SchedulingRule>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <name>SchedulingRule</name>
5	<members>MaxShiftsPerWeek</members>
6    </types>
7    <version>53.0</version>
8</Package>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.