SharedTo

SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.

See Sharing Considerations and Public and Personal Groups in Salesforce Help.

SharedTo is included in the metadata for shared and private list views. SharedTo isn’t in the metadata for public list views.

Note

File Suffix and Directory Location 

SharedTo is used with ListView, Folder, and SharingRules.

Version 

SharedTo is available in API version 17.0 and later.

Fields 

allCustomerPortalUsers 

  • Type: string
  • Required: No
  • Introduced: API version 24.0
  • Description: A group containing all customer portal users.

allInternalUsers 

  • Type: string
  • Required: No
  • Introduced: API version 24.0
  • Description: A group containing all internal and nonportal users.

allPartnerUsers 

  • Type: string
  • Required: No
  • Introduced: API version 24.0
  • Description: A group containing all partner users.

allRestrictedEmployeeUsers 

  • Type: string
  • Required: No
  • Introduced: API version 68.0
  • Description: A group containing only employee users with the Unified Employee license. Use to extend these users’ access.

channelProgramGroup 

  • Type: string[]
  • Required: No
  • Introduced: API version 41.0
  • Description: A system-managed group with sharing access containing all partner members of the corresponding channel program or level.

channelProgramGroups 

  • Type: string[]
  • Required: No
  • Introduced: API version 41.0
  • Description: A list of system-managed groups with sharing access containing all partner members of the corresponding channel programs or levels.

group 

  • Type: string[]

  • Required: No

  • Introduced: API version 22.0

  • Description: A list of groups with sharing access. Use this field instead of the groups

    field.

groups 

  • Type: string[]

  • Required: No

  • Description: A list of groups with sharing access.

    Use the group field instead for API version 22.0 and later.

guestUser 

  • Type: string[]
  • Required: No
  • Introduced: API version 47.0
  • Description: A list of guest user nicknames with sharing access. This field can be used only with SharingGuestRule.

managers 

  • Type: string[]
  • Required: No
  • Introduced: API version 24.0
  • Description: A list of users whose direct and indirect managers receive sharing access.

managerSubordinates 

  • Type: string[]
  • Required: No
  • Introduced: API version 24.0
  • Description: A list of users whose direct and indirect subordinates receive sharing access.

portalRole 

  • Type: string[]
  • Required: No
  • Introduced: API version 24.0
  • Description: A list of groups with sharing access containing all users in a portal role.

portalRoleAndSubordinates 

  • Type: string[]
  • Required: No
  • Introduced: API version 24.0
  • Description: A list of groups with sharing access containing all users in a portal role or any users under that role.

queue 

  • Type: string[]
  • Required: No
  • Introduced: API version 24.0
  • Description: A list of queues with sharing access. Applies only to lead, case, and CustomObject sharing rules.

role 

  • Type: string[]

  • Required: No

  • Introduced: API version 22.0

  • Description: A list of roles with sharing access. Use this field instead of the roles

    field.

roleAndSubordinates 

  • Type: string[]

  • Required: No

  • Introduced: API version 22.0

  • Description: A list of roles with sharing access. All roles below each of these roles in the role hierarchy also have sharing access. If portal accounts are enabled, then all roles and portal accounts below each of these roles in the role hierarchy also have sharing access. Use this field instead of the rolesAndSubordinates

    field.This field is available in API version 22.0 and later and is only available when digital experiences is enabled for your org and Experience Cloud site users are created with external account roles other than a shared person account role.

roleAndSubordinatesInternal 

  • Type: string[]
  • Required: No
  • Introduced: API version 22.0
  • Description: A list of roles with sharing access. All roles below each of these roles in the role hierarchy also have sharing access.

roles 

  • Type: string[]

  • Required: No

  • Description: A list of roles with sharing access.

    Use the role field instead for API version 22.0 and later.

rolesAndSubordinates 

  • Type: string[]

  • Required: No

  • Description: A list of roles with sharing access. All roles below each of these roles in the role hierarchy also have sharing access. If portal accounts are enabled, then all roles and portal accounts below each of these roles in the role hierarchy also have sharing access.

    Use the roleAndSubordinates field instead for API version 22.0 and later.

territories 

  • Type: string[]

  • Required: No

  • Description: A list of territories with sharing access.

    Use the territory field instead for API version 22.0 and later.

territoriesAndSubordinates 

  • Type: string[]

  • Required: No

  • Description: A list of territories with sharing access. All territories below each of these territories in the territory hierarchy also have sharing access.

    Use the territoryAndSubordinates field instead for API version 22.0 and later.

territory 

  • Type: string[]

  • Required: No

  • Introduced: API version 22.0

  • Description: A list of territories with sharing access. Use this field instead of the territories

    field. If you’re using Sales Territories, use modelName.territoryName for the shared-to and shared-from territory values, where:

    • modelName equals the name of the active territory model in the API.
    • territoryName equals the territory’s name in the API.

territoryAndSubordinates 

  • Type: string[]

  • Required: No

  • Introduced: API version 22.0

  • Description: A list of territories with sharing access. All territories below each of these territories in the territory hierarchy also have sharing access. Use this field instead of the territoriesAndSubordinates

    field. If you’re using Sales Territories, use modelName.territoryName for the shared-to and shared-from territoryAndSubordinates values, where:

    • modelName equals the name of the active territory model in the API.
    • territoryName equals the territory’s name in the API.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!