---
schema_version: "1"
id: 1e5de8c8c1ff1efe5f4af82a3a315de38fe16de0c584ed9f25cb989f3d08ae55
title: SchedulingConstraint
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_schedulingconstraint.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_schedulingconstraint.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 13d56ba249725aac613d463e477ffbcd354efb575b0a822ecddc865aea383d99
description: Represents scheduling constraints on each service resource. This object is available in API version 50.0 and later.
---
# SchedulingConstraint

Represents scheduling constraints on each service resource. This object is available in API version 50.0 and later.

## Supported Calls

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

## Special Access Rules

The org requires the Workforce Engagement license. To view records, the user requires the Workforce Engagement Agent permission set. To create, edit, or delete records, the user requires the Workforce Engagement Planner permission set.

## Fields

| Field | Details |
| --- | --- |
| LastReferencedDate | 
Type

dateTime

Properties

Filter, Nillable, Sort

Description

The date when the scheduling constraint was last modified. Its label in the user interface is Last Modified Date.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The date when the scheduling constraint was last viewed.



 |
| MaxNonstandardShiftsPerMonth | 

Type

int

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The maximum number of non-standard shifts assigned to an agent in a month.

This field is available in API version 54.0 and later.



 |
| MaxShiftsPerDay | 

Type

int

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The maximum number of shifts an agent can have in a day.



 |
| MaxShiftsPerMonth | 

Type

int

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The maximum number of shifts an agent can have in a month.



 |
| MaxShiftsPerWeek | 

Type

int

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The maximum number of shifts an agent can have in a week.



 |
| MaxWorkingHoursPerDay | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

The maximum number of hours an agent can have in a day.



 |
| MaxWorkingHoursPerMonth | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

The maximum number of hours an agent can have in a month.



 |
| MaxWorkingHoursPerWeek | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

The maximum number of hours an agent can have in a week.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, idLookup, Sort, Update

Description

The scheduling constraint record name.



 |
| OwnerId | 

Type

reference

Properties

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

Description

The owner of the scheduling constraint.

This is a polymorphic relationship field.

Relationship Name

Owner

Relationship Type

Lookup

Refers To

Group, User



 |
| RestTimeMinutes | 

Type

int

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The minimum rest time, in minutes, between an agent’s consecutive shifts.

This field is available in API versions 56.0 and later.



 |

## Associated Objects

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.

[SchedulingConstraintOwnerSharingRule](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.

[SchedulingConstraintShare](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.