I know there is possibility to turn on this feature using Scratch Org config file.

"orgName": "Scratch1",
"language": "en_US",
"edition": "Enterprise",
"features": ["Entitlements","MultiCurrency", "API", "AuthorApex", "ContactsToMultipleAccounts", "ProcessBuilder", "StateAndCountryPicklist", "DeferSharingCalc"],
"settings": { 
        "translation": true,
        "chatterEnabled" : true,
        "disableParallelApexTesting" : true,
        "pathAssistantsEnabled" : true,
        "notesReservedPref01" : true
    "orderSettings": { 
        "enableOrders": true
    "accountSettings": {
        "enableAccountTeams": true
    "opportunitySettings": {
        "enableOpportunityTeam": true
    "quoteSettings": {
        "enableQuote": true


issue is this does not work for me and all my new orgs automatically try to recalculate sharing on sfdx push - and it fail. Was anyone able to create scratch with this function enabled? I can't see what I am doing wrong... I will appreciate any help! :)

  • Do you see the "Defer Sharing Calculations" in the setup menus after creating a scratch org with DeferSharingCalc? I don't – Daniel Ballinger Jul 9 '19 at 1:43
  • Hi @DanielBallinger, in fact I can see it setup. Issue is both (Sharing and group) calculations are enabled and I don't have any option to disable it... – Artur Kępczyński Jul 9 '19 at 5:38
  • I did not tried it yet... Still it feels like cheap shot and may potentially cause some issues for development (difference in editions etc...). Anyway, it is not solution but still - something I can try :) – Artur Kępczyński Jul 9 '19 at 8:30
  • I think it’s uncool to open a bounty and then not respond to answers. I see no reason why you don’t select my answer as the answer? – Robert Sösemann Jul 15 '19 at 16:37

DeferSharingCalc is first step to enable Defer Sharing Calculations feature in scratch orgs. For using this feature, User should have Manage Users AND Manage Sharing Calculation Deferral permissions. Create a permission set with these permissions and assign it to user, then you will be able to use this feature in scratch orgs.


According to Salesforce this is a somewhat cumbersome two way step where using this org feature needs to be accompanied with a second manual step:

Enabling the Defer Sharing Rule Calculation feature typically requires two steps - contacting Salesforce support and then enabling the feature in the UI (https://help.salesforce.com/articleView?id=security_sharing_rule_recalculation.htm&type=5). It appears that the scratch feature "DeferSharingRecalc" is helping with the first step but it requires the user to provision the appropriate permission and then Suspend, Resume or Recalculate sharing rules in the UI.

See github issues

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.