---
schema_version: "1"
id: 79dda886285e088eac63a5cb0615be80e45f8cfa5540dd26c940eef9c23217e8
title: Run the Account Sharing Batch Script
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_task_admin_running_batch_script.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_running_batch_script.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d0c518a851448ed075c34b175e38bb6ce3637fc0e4d2a83ad0a2b6ea535848e6
description: Run the account-sharing batch script manually to update the Sharing Criterion field values in the database.
products:
  - Consumer Goods
release: "264"
---
# Run the Account Sharing Batch Script

Run the account-sharing batch script manually to update the Sharing Criterion field values in the database.

### 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: Lightning Experience in <strong>Professional</strong>, <strong>Enterprise</strong>, and <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled</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="d91441e63">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d91441e63 ">To run the account sharing batch script:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d91441e63 ">
              <p>CGCloud Business Admin</p>
              <p style="margin-bottom:0;">OR</p>
              <p style="margin-bottom:0;">CGCloud Retail Business Admin</p>
            </td>

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

1. From Setup, in the Quick Find box, enter Apex Classes, and select **Apex Classes**.
2. Select **Developer Console**.
3. Select **Debug | Open Execute Anonymous Window**.
4. Enter this code:
    
    `Database.executeBatch(new AccountSharingCriterionBatch());`
5. Click **Execute**.