---
schema_version: "1"
id: fc379390d42df3f40f34bf4810d9dc8ce126bb8d9203696397a5b34cc01590c2
title: ShiftOwnerSharingRule
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_shiftownersharingrule.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_shiftownersharingrule.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1079836e96073a8951153b971ce2171d5a8605176714549535036a7f50a891bb
description: Represents the rules for sharing a shift with user records other than the owner or anyone above the owner in the role hierarchy. Available in API versions 46.0 and later.
---
# ShiftOwnerSharingRule

Represents the rules for sharing a shift with user records other than the owner or anyone above the owner in the role hierarchy. Available in API versions 46.0 and later.

## Supported Calls

describeSObjects(), getDeleted(), getUpdated(), query(), retrieve()

## Special Access Rules

Field Service must be enabled.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

To enable access to this object for your org, contact Salesforce customer support. However, we recommend that you instead use Metadata API to programmatically update owner sharing rules because it triggers automatic sharing rule recalculation. The [SharingRules](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/meta_sharingrules.htm) Metadata API type is enabled for all orgs.

## Fields

| Field | Details |
| --- | --- |
| Description | 
Type

textarea

Properties

Create, Filter, Nillable, Sort, Update

Description

A description of the sharing rule. Maximum size is 1000 characters.



 |
| DeveloperName | 

Type

string

Properties

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

Description

The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object's name in a managed package and the changes are reflected in a subscriber's organization. Corresponds to **Rule Name** in the user interface.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance slows down while Salesforce generates one for each record.















 |
| GroupId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID representing the source group. A time sheet owned by a User in the source Group triggers the rule to give access.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, Sort, Update

Description

Label of the sharing rule as it appears in the user interface. Limited to 80 characters. Corresponds to **Label** on the user interface.



 |
| ServiceResourceAccessLevel | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

A value that represents the type of access granted to the target Group, or UserRole. The possible values are:

- Read
- Edit
- All





 |
| UserOrGroupId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID representing the User or Group being granted access.



 |

## Usage

Scheduling and dispatching service resources using shift data is not supported in API version 46.0.