---
schema_version: "1"
id: 9cedc46dd0299746b8b9ecbf46c77591620ba2dfb03adea9d3739b9c1c2a6ff0
title: Shift
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_shift.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_shift.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 84b8f10367427c65f27c8b8e679f97de623e21842af26e54e9f12d353ef7aff8
description: Represents a shift for service resource scheduling. Available in API versions 46.0 and later.
---
# Shift

Represents a shift for service resource scheduling. Available in API versions 46.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), upsert()

## Special Access Rules

Field Service, Service Engagement, or Workforce Engagement must be enabled. For Field Service, users must have Field Service permissions. For Service Engagement, users must have the Service Engagement Planner permission set. For Workforce Engagement, users must have the Workforce Engagement Admin or Planner permission set.

## Fields

| Field | Details |
| --- | --- |
| BackgroundColor | 
Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Sets a background color when shifts are displayed in the UI. Use a 3- or 6-digit hexadecimal format, for example #FF00FF. Available in API version 54.0 and later.



 |
| EndTime | 

Type

dateTime

Properties

Create, Filter, Sort, Update

Description

The date and time that the shift ends.



 |
| IsHolidayShift | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Indicates a shift that overlaps with holiday hours. The default value is false. Available in API version 55.0 and later.



 |
| IsNonStandard | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Indicates whether the shift is nonstandard, such as overtime or on-call shifts.

The default value is false. Available in API version 54.0 and later.



 |
| JobProfileId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The job profile associated with the shift. Available in API versions 47.0 and later.



 |
| Label | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The label that a shift is given.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

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



 |
| RecordsetFilterCriteriaId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the recordset filter criteria selected for the shift. Available in API version 49.0 and later.

This is a relationship field.

Relationship Name

RecordsetFilterCriteria

Relationship Type

Lookup

Refers To

RecordsetFilterCriteria



 |
| ServiceResourceId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the service resource the shift belongs to. Available in API versions 47.0 and later.

This is a relationship field.

Relationship Name

ServiceResource

Relationship Type

Lookup

Refers To

ServiceResource



 |
| ServiceTerritoryId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the service territory the shift belongs to. Available in API versions 47.0 and later.

This is a relationship field.

Relationship Name

ServiceTerritory

Relationship Type

Lookup

Refers To

ServiceTerritory



 |
| ShiftNumber | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, idLookup, Sort

Description

The number automatically given to the shift upon creation.



 |
| ShiftTemplateId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort

Description

The shift template ID, if the shift was created from a shift template. Available in API version 53.0 and later.

This is a relationship field.

Relationship Name

ShiftTemplate

Relationship Type

Lookup

Refers To

ShiftTemplate



 |
| StartTime | 

Type

dateTime

Properties

Create, Filter, Sort, Update

Description

The date and time that the shift starts.



 |
| Status | 

Type

picklist

Properties

Create, Filter, Group, Sort, Update

Description

Describes the status of the shift. Users can create custom values. Default values are:

- Tentative
- Published
- Confirmed





 |
| StatusCategory | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

Describes the status of the shift using static values. This field is derived from Status using the mapping defined in setup.

Possible values are:

- Tentative
- Published
- Confirmed





 |
| TimeSlotType | 

Type

picklist

Properties

Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update

Description

Type of time slot for the shift. The same setup values as the TimeSlot field in the OperatingHours object.

Possible values are:

- Normal (default value)
- Extended





 |

## Usage

Scheduling and dispatching service resources using shift data is not supported in API version 46.0, and is a pilot feature in API version 47.0.

## Associated Objects

This object has the following associated objects. Unless noted, they are available in the same API version as this object.

[ShiftChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_change_event.htm "A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn’t a Salesforce object—it doesn’t support CRUD operations or queries. It’s included in the object reference so you can discover which Salesforce objects support change events.") (API version 54.0)

Change events are available for the object.

[ShiftFeed](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")

Feed tracking is available for the object.

[ShiftHistory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[ShiftOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.")

Sharing rules are available for the object.

[ShiftShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")

Sharing is available for the object.