---
schema_version: "1"
id: a766c70aefe51efa64d7b3b7b60c1e77ac65686b725c6924f94130eb3bf718fc
title: Create Apex Sharing Reasons
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/security_apex_sharing_reasons.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.security_apex_sharing_reasons.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2ff5b2a15822be1689ab4f0508e9db9c86b219871ee0e45c0e64dadbdc7b465c
description: When creating Apex managed sharing, create Apex sharing reasons for individual custom objects to indicate why sharing was implemented.
products:
  - Salesforce Platform
release: "264"
---
# Create Apex Sharing Reasons

When creating Apex managed sharing, create Apex sharing reasons for individual custom objects to indicate why sharing was implemented.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Database.com</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d5596e79">User
              Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d5596e79 ">To create Apex sharing reasons:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d5596e79 ">Author Apex</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d5596e79 ">To view Apex sharing reasons:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d5596e79 ">View Setup and Configuration</td>

          </tr>
        </tbody>
      </table>

When creating Apex managed sharing, create Apex sharing reasons for individual custom objects to indicate why sharing was implemented, simplify the coding required to update and delete sharing records, and share a record multiple times with the same user or group using different Apex sharing reasons.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note For more information on Apex managed sharing, see the [Apex Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_security_sharing_chapter.htm).

Salesforce displays Apex sharing reasons in the Reason column when viewing the sharing for a custom object record in the user interface. This allows users and administrators to understand the purpose of the sharing.

When working with Apex sharing reasons, note the following:

- Only users with the “Modify All Data” permission can add, edit, or delete sharing that uses an Apex sharing reason.
- Deleting an Apex sharing reason will delete all sharing on the object that uses the reason.
- You can create up to 10 Apex sharing reasons per custom object.
- You can create Apex sharing reasons using the Metadata API.

To create an Apex sharing reason:

1. From the management settings for the custom object, click **New** in the Apex Sharing Reasons related list.
2. Enter a label for the Apex sharing reason. The label displays in the Reason column when viewing the sharing for a record in the user interface. The label is also enabled for translation through the Translation Workbench.
3. Enter a name for the Apex sharing reason. The name is used when referencing the reason in the API and Apex. 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.
4. Click **Save**.

#### See Also

- [Recalculate Apex Managed Sharing](https://help.salesforce.com/s/articleView?id=platform.security_apex_sharing_recalc.htm&release=264.0.0&type=5 "Developers can write batch Apex classes that recalculate the Apex managed sharing for a specific custom object.")
- [Find Object Management Settings](https://help.salesforce.com/s/articleView?id=platform.extend_click_find_objectmgmt_parent.htm&type=5&language=en_US)