Salta ai contenuti

When Sharing Recalculates, and What It Locks

Questi contenuti non sono ancora disponibili nella tua lingua.

Module 4 of 6 in the chapter Sharing at Scale, chapter 22 of Securing Salesforce: Sharing and Visibility. Each module stands on its own.

The question this module answers: You change a default, a rule, a role or a group. When does access actually change, what can’t you touch while it does, and what’s left behind afterwards?

A sharing change is a promise: from now on, these people see these records. Salesforce keeps that promise by recalculating, adding and removing share rows until the tables match the new design. Module 1 counted the rows; module 3 showed the locks while groups change. This module is about the recalculation itself: how each kind runs, what it holds, and what it leaves.

Salesforce has changed how much of this happens in the background over the last few releases. So I’ll give you each piece with its date.

You changeHow Salesforce recalculatesWhere it’s taught
An org-wide default or a sharing ruleAutomatically, “asynchronously and in parallel”; the account family together; Apex sharing recalculations run too; an email when it’s doneBelow, and chapter 7 module 2
A role or a group, at volumeSome recalculation runs asynchronously, so access can arrive a little later; a release update, enforced in Spring ‘27Chapter 11 module 5, chapter 8 module 4
The rules behind Apex managed sharingYour own batch class, attached to the custom objectChapter 11 module 5
Many changes at once, in a realignmentDeferred: suspend, change, then recalculate onceModule 5

The first row is worth reading closely, because it’s the one everyone meets. “When you update organization-wide defaults or sharing rules, automatic sharing recalculation is processed asynchronously and in parallel” (Automatic Recalculation of Org-Wide Defaults and Sharing Rules (opens in a new tab), Salesforce Help, checked 2026-11-26). Three details from the same page:

  • The account family moves together. “If sharing rules are recalculated for accounts, cases, contacts, or opportunities, sharing rules are also recalculated for the other three objects,” because cases, contacts and opportunities are children of accounts.
  • Apex comes along. “When sharing is recalculated, Salesforce also runs all Apex sharing recalculations.” The batch class from chapter 11 runs whether you asked for it or not.
  • You can watch it. “You can monitor the progress of your parallel sharing rule or organization-wide default recalculation on the Background Jobs page,” and you get an email when it’s done.

For the second row, the date matters. The asynchronous recalculation after role and group changes is a release update, first available in Spring ‘26 and enforced in Spring ‘27. Code that changes a role and then expects the new access on the next line is the code to find before then. Release updates can move, so check its date on the Release Updates page in Setup.

Here’s that release update on its own card, with its dates:

Setup, Release Updates: a card titled Update Apex Code and Flows for Changed Sharing Recalculation Behavior, complete steps by January 1, 2027, enforcement scheduled Spring '27, with Salesforce's text: to optimize performance after large-scale updates to groups or roles, Salesforce performs some sharing recalculations asynchronously; update Apex code and flows that update group membership or roles if they rely on synchronous sharing recalculation. Below it, Retire Legacy Authentication for Salesforce Connect Cross-Org Adapter, complete steps by February 1, 2027.

The update on Salesforce’s own card, enforcement scheduled for Spring ‘27; check your own org’s card for its date (Salesforce, Setup in a Partner Developer Edition org, screenshot, November 2026). Full size

While a recalculation runs, some changes wait. Salesforce calls the rules for this object-specific share locks: “The object-specific share locks feature enables you to make changes to a sharing rule for other objects simultaneously,” and “without object-specific share locks, you can’t submit simultaneous sharing changes until recalculation across all objects is complete” (Object-Specific Share Locks (opens in a new tab), Salesforce Help, checked 2026-11-26).

What’s locked, in Salesforce’s words (same page):

  • Criteria-based rules. While one recalculates, “you can’t edit or delete that rule. But you can create, edit, or delete any other criteria-based or owner-based sharing rule for that object.”
  • Owner-based rules. While one recalculates, “you can’t create, edit, or delete owner-based sharing rules for that object targeting the same group of users.” Other target groups are fine.
  • Defaults and rules block each other. “You can’t modify the org-wide defaults when a sharing rule recalculation for any object is in progress. Similarly, you can’t modify sharing rules when recalculation for an org-wide default update is in progress.”
  • The account family is locked together. “Locks aren’t shared across objects, except across accounts and associated account children”: a change to an account rule blocks case, contact and opportunity rules until it finishes.

And one instruction worth taping to the monitor: “Use the Recalculate buttons on the Sharing Rules related lists only if sharing rule updates have failed or aren’t working as expected.” Clicking Recalculate “locks sharing rules for that object.” It isn’t a refresh button.

So plan the order of sharing changes the way you’d plan a deployment: defaults first or rules first, not both at once; account-family changes one at a time; and nobody pressing Recalculate to see if it helps.

When access goes, and when it doesn’t, yet

Section titled “When access goes, and when it doesn’t, yet”

The last piece is cleanup. When the reason for a share goes away, the share row has to go too. Salesforce does some of that later, on purpose: “Obsolete shares are removed asynchronously after groups are deleted or users are deactivated so that admins can perform other operations without waiting for shares to be deleted” (Asynchronous Deletion of Obsolete Shares (opens in a new tab), Salesforce Help, checked 2026-11-26).

Two cases, and they behave differently (same page):

  • Deleting a public group, queue, role or territory. The shares to it become obsolete and are deleted “during off-peak hours,” but the access goes at once: “Members of these groups lose access to records immediately. Users higher than these members in the role hierarchy also lose access.”
  • Deactivating a user. Their “manually assigned shares and their team shares are deleted asynchronously. Until the obsolete shares are deleted, users higher in the role hierarchy retain access to the records associated with these shares.” Salesforce’s advice: “If that visibility is a concern, remove the record access granted to the user before deactivating the account.”

Read that second one again with a leaver in mind. Someone leaves, you deactivate them, and for a while their manager can still see the records that were shared with them by hand or through a team. Usually that’s fine. For a confidential case or an HR record, it isn’t. That’s the access-that-ends question from chapter 3 module 4, and the answer is a step in your leaver process, before deactivation.

When sharing recalculates, and what it locks When sharing recalculates, and what it locks. Change an org-wide default or a sharing rule: Salesforce recalculates automatically, asynchronously and in parallel, the account family together, with Apex sharing recalculations alongside; while it runs, the defaults and the rules block each other, and the account family's rules are locked together. Change a role or a group at volume: some recalculation runs asynchronously, a release update enforced in Spring '27, so access can arrive a little later, and code that checks it on the next line breaks. Deactivate a user or delete a group: obsolete shares are deleted later, off-peak; until then, a deactivated user's manual and team shares stay visible to the managers above. Footnote: plan the order of sharing changes like a deployment, and don't press Recalculate to see if it helps. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.60.0", "built": "2026-11-23", "id": "DGM-SVA-SCL-04", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.5.0"} YOU CHANGE HOW IT RECALCULATES WHILE AND AFTER A default or a rule org-wide default, sharing rule Parallel and asynchronous the account family together; Apex recalculations too Locks defaults and rules block each other; the account family locked together A role or a group at volume Partly asynchronous release update, enforced Spring '27 Access a little later code that checks it on the next line breaks A deactivated user or a deleted group Shares deleted later obsolete shares, off-peak Managers still see a deactivated user's manual and team shares, until deleted recalculates while it runs recalculates afterwards cleans up until then Plan the order of sharing changes like a deployment, and don't press Recalculate to see if it helps. HOW TO READ IT plan for it © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Test knowledge. Know that org-wide default and sharing rule changes recalculate automatically, asynchronously and in parallel, with the account family (accounts, cases, contacts, opportunities) together and Apex sharing recalculations alongside; that object-specific share locks let you change other objects’ rules while one recalculates, but org-wide defaults and rules block each other and the account family is locked together; that the Recalculate button is for failed updates only; that role and group changes are moving to asynchronous recalculation; and that obsolete shares are deleted asynchronously, so a deactivated user’s manual and team shares stay visible to the role hierarchy above until deleted. This supports IMP-1, the scalability implications of the sharing solution. A likely area, not a known question.

  • The order of sharing changes in any release: defaults and rules apart, account-family changes one at a time.
  • Who may press Recalculate, and when (only after a failed update).
  • Which code changes roles or groups and then relies on the new access straight away, before the Spring ‘27 enforcement.
  • Where recalculation is watched: the Background Jobs page, and who reads the completion email.
  • A leaver step that removes manual and team access before deactivation, where the records are sensitive.

Beyond the exam: what AI changes. “Fix the sharing so the West team can see these accounts” is one sentence to an agent and a recalculation to Salesforce. If the agent makes five such changes in a minute, the share locks decide which ones wait. Let it propose the changes; schedule them like any other.