コンテンツにスキップ

Sharing Model

This content is for the 1.0 version. Switch to the latest version for up-to-date documentation.

このコンテンツはまだ日本語訳がありません。

flowchart TB
    subgraph SHARING["SHARING ARCHITECTURE"]
        subgraph OTM["ObjectTeamMember__c"]
            OTM1["OWD: Private"]
            OTM2["Sharing: Custom via ObjectTeamMember__Share"]
            OTM3["RowCause: ManualAccess__c"]
        end

        subgraph TSC["Team_Sharing_Config__c"]
            TSC1["OWD: Public Read Only"]
            TSC2["All users can read, admins modify"]
        end

        subgraph PARENT["Parent Objects<br/>(Account, Case, etc.)"]
            P1["Requires: Private or Public Read Only OWD"]
            P2["Sharing: Via [Object]Share"]
            P3["RowCause: Manual"]
        end
    end
  • OWD: Private
  • Sharing mechanism: Custom sharing via ObjectTeamMember__Share
  • RowCause: ManualAccess__c

When a team member is added, the system creates an ObjectTeamMember__Share record so the team member can see their own team membership record.

  • OWD: Public Read Only
  • All users can read configuration (needed for component rendering)
  • Only administrators can modify configurations
  • Requirement: Objects must have Private or Public Read Only OWD
  • Sharing mechanism: Via standard [Object]Share tables (e.g., AccountShare, CaseShare)
  • RowCause: Manual

When a team member is added with an access level, it maps to Salesforce share record access:

ObjectTeamMember__c Access_Level__c[Object]Share AccessLevelDescription
Read OnlyReadTeam member can view the record
Read/WriteEditTeam member can view and edit the record

When a team member is added:

  1. ObjectTeamMember__c record is inserted
  2. Trigger fires and enqueues ShareRecordQueueable
  3. Queueable creates two share records:
    • Parent share: [Object]Share record giving the user access to the parent record
    • Team member share: ObjectTeamMember__Share record giving the user visibility of their team membership

When a team member’s access level changes:

  1. ObjectTeamMember__c record is updated
  2. Trigger fires and enqueues ShareRecordQueueable
  3. Queueable deletes old share and creates new one with updated access level

When a team member is removed:

  1. ObjectTeamMember__c record is deleted
  2. Trigger fires and enqueues ShareRecordQueueable
  3. Queueable deletes both share records (parent and team member)

When a sharing configuration is toggled:

  • Deactivated: SharingRecalculationBatch removes all share records for that object
  • Reactivated: SharingRecalculationBatch recreates share records for all existing team members
ObjectShare Table
AccountAccountShare
ContactContactShare
CaseCaseShare
LeadLeadShare
OpportunityOpportunityShare
CampaignCampaignShare
OrderOrderShare

Custom objects follow the pattern: ObjectName__cObjectName__Share

The system uses a hardcoded whitelist for standard objects and derives the share table name for custom objects automatically.

  • Salesforce Enterprise Edition or higher (for sharing model support)
  • Objects must have Private or Public Read Only OWD to benefit from sharing
  • Users need appropriate permission set assigned
  • Users need base object access (e.g., Account read access to use Account teams)