Loading

Asynchronous Sharing Recalculation After Group Membership or Role Changes

Data pubblicazione: Aug 18, 2026
Descrizione

Salesforce is implementing enhancements to the sharing recalculation process to improve performance for large-scale transactions in Salesforce. After group deletion, group membership changes, or role updates occur, related owner-based sharing rules and account owner share records are recalculated asynchronously when that approach results in better performance.

This change is most relevant for customers who change the group or role membership of one or more users with a very high ownership data skew — for example, a single user who owns hundreds of thousands of records of the same object. If your Salesforce org meets this criteria, the information in this knowledge article applies to you.

Risoluzione

This article explains how Salesforce's asynchronous sharing recalculation works after group deletion, group membership changes, or role updates, what triggers it, how it can affect Apex code and flows, and how to monitor recalculation progress.

Background

A share record (or sharing row on a share table) indicates the access that a user, group, or role has to a record. When group deletion, group membership changes, or role updates occur, recalculations are triggered to make sure that share records are accurate and record access is up-to-date. Group membership or role changes result in three steps:

  1. Updates to group maintenance tables, which specify the membership data for all groups and roles, for both direct and indirect members.
  2. (For changes to roles or role assignments only) Updates to account owner share records. Account owners can get default access to case, contact, and opportunity records depending on their role. When roles or role assignments are updated, these share records are also updated.
  3. Recalculation of owner-based sharing rules. Owner-based sharing rules grant access to records owned by members of a group or role to members of other groups or roles. When a user, group, or role is added to a group or role that is the source of an owner-based sharing rule, sharing rows are created to represent this access. The reverse occurs when users, groups, or roles are removed from the source group or role.

Before this change, all three of these steps were executed synchronously and these operations blocked other processes until completion.

Updated Behavior

After group deletion, group membership changes, or role updates occur:

  1. The group or role changes are processed synchronously (no change from current behavior).
  2. Related owner-based sharing rules and account owner share records are recalculated asynchronously if the system determines that this yields better performance.

Whether asynchronous recalculation occurs is dynamic and depends on several factors, including record ownership of all impacted users, operational complexity, and database resource availability. Synchronous recalculation still occurs when it's determined to be more performant, which is usually the case. But when the system calculates that asynchronous recalculation is better for a large transaction, this optimized approach allows for smoother operations and faster response times.

Example: Role Assignment

When you assign a user to a role, sharing rows must be updated so that access is correctly granted to that user, superiors in the role hierarchy, and users who have access via sharing rules. For example, a user named Carole White has a very high ownership data skew because she owns more than 300,000 records of the same type. Carole doesn't currently have a role. The role hierarchy is: CEO, under which sits SVP of Technology (with VP of Information Technology under it) and SVP of Business Operations. There's also an existing sharing rule that shares records owned by users in the VP of Information Technology role with users in the SVP of Business Operations role.

Carole is assigned the VP of Information Technology role. With this new role:

  • Users in roles above Carole's role (SVP of Technology and CEO) gain access to the 300,000 records she owns.
  • Users in the SVP of Business Operations role gain access to Carole's records via the sharing rule.
  • Carole gains access to records accessible to any roles below her in the hierarchy or accessible via sharing rules targeting her role.

Because of the scale of these changes and current system availability, the system determines it's better to recalculate owner-based sharing rules asynchronously. The role assignment update is processed first, and the user can make other role changes immediately, while the sharing recalculation proceeds in the background.

Example: Role Reparenting

Role reparenting is when you move a user or role that reports to one role so that it instead reports to a different role. Using the same hierarchy: Carole White's VP of Information Technology role currently reports to SVP of Technology. You move it so it instead reports to SVP of Business Operations.

Sharing rows must be updated so access is granted correctly through the new role hierarchy and sharing rules. Users in the SVP of Technology role lose access to Carole's records, while users in the SVP of Business Operations role gain access via the hierarchy instead of the prior sharing rule. Because of Carole's high ownership data skew combined with the complexity of this change, the system determines it's better to recalculate owner-based sharing rules asynchronously. The role change is processed immediately, and the sharing recalculation proceeds in the background.

Example: Group Membership Assignment

Group membership assignment (or unassignment) is when you add or remove a user or group to or from another group. Continuing the example: Carole White's role now reports to SVP of Business Operations, but SVP of Technology still needs access to the accounts she owns. You create a group called Technology Users and an owner-based sharing rule where the source is the Technology Users public group and the target is the SVP of Technology role.

After adding Carole White to the Technology Users public group, owner-based sharing rules are recalculated so access stays up-to-date across all the records she owns. Because of Carole's high ownership data skew, the system determines it's best to calculate the sharing rules asynchronously. The group membership change is processed immediately, and the sharing recalculation proceeds in the background.

Required Updates to Apex Code and Flows

Most group membership or role changes don't lead to asynchronous sharing recalculation. However, review this section if your Salesforce org meets all of the following criteria, to avoid later issues with Apex code (including classes, tests, and triggers) and flows:

  • Has large data volumes and a very high ownership data skew (for example, a single user owning hundreds of thousands of records of the same object).
  • Has Apex code or flows that modify group membership or roles.
  • Has Apex code or flows that rely on the immediate availability of updated share records after updates to groups or roles.

If your org doesn't meet this criteria, asynchronous sharing recalculation is less likely to occur and impact your Apex code and flows, and the steps below may not be necessary.

With asynchronous recalculation, share records aren't updated immediately. If Apex classes, Apex tests, Apex triggers, or flows rely on the immediate availability of updated share records after updates to groups or roles, the code or flows can break. For example:

  • A SOQL query or assertion for share records with the row cause 'Rule' fails if it expects the records to be created immediately.
  • The System.runAs() method won't reflect a user's expected access until the asynchronous sharing recalculation is completed.

To prepare for this change:

  1. Review the Update Apex Code and Flows for Changed Sharing Recalculation Behavior Salesforce release update in Setup for detailed steps on identifying and fixing impacted code and flows.
  2. To identify impacted Apex code and flows, enable "Test asynchronous sharing recalculation in Apex tests" on the Sharing Settings page. Failing tests indicate that the code relies on synchronous sharing recalculation and requires updates.
  3. Update the identified Apex code and flows so that they verify share records, such as AccountShare records, are updated before proceeding.
  4. After updating your Apex code and flows, disable "Test asynchronous sharing recalculation in Apex tests" to prevent false errors.
  5. Test all changes in a sandbox before enabling the release update in production.

The release update was made available starting in Spring '26 and will be enforced in Spring '27.

Timeline

This change was introduced in Summer '25 and rolled out over several releases. Salesforce completed the enablement of this updated behavior in all orgs in April 2026.

The one exception is for changes that originate from Apex code and flows, whose sharing recalculation continues to run synchronously until the Update Apex Code and Flows for Changed Sharing Recalculation Behavior release update is enforced in Spring '27.

Monitor Recalculation Progress - Asynchronous Recalculation of Sharing Rules - Setup Audit Trail

When asynchronous recalculation of owner-based sharing rules occurs after group membership or role updates, you see three rows in the Setup Audit Trail. The first row indicates that the group membership or role updates were processed synchronously. The next two rows indicate when the asynchronous recalculation of owner-based sharing rules is initiated and completed.

If the asynchronous recalculation fails after several attempts, an entry is logged in the Setup Audit Trail.

Background Jobs

When asynchronous recalculation of owner-based sharing rules occurs after group membership or role updates, the update is also logged on the Background Jobs page. The Job Sub Type is listed as "{Object} - Async Owner Sharing Rule Recalculation."

Emails

The Salesforce admin who initiated the group membership or role update receives an email when asynchronous recalculation has started. The admin then receives an email after the recalculation completes successfully, or an email if the recalculation fails after several attempts, with details for contacting Salesforce Customer Support.

Synchronous Recalculation of Sharing Rules

If it's more performant to recalculate owner-based sharing rules synchronously, as before, you see only one row in the Setup Audit Trail indicating that both the group membership or role updates and sharing rule recalculation are completed.

Numero articolo Knowledge

005103630

 
Caricamento
Salesforce Help | Article