0

Working with scratch orgs, I need to enable OpportunitySplits completely at the point of Scratch Org Creation, and Source Push.

Currently, when successfully pushing the below files and settings. The Opportunity Split Settings page still prompts the user to have to manually enable this.

How can I enable this in the Scratch Org so that I don't have to rely on a manual step? Thanks!

Opportunity Splits Settings page

Below Files

project-scratch-def.json

{
    "orgName": "OrgName",
    "edition": "Enterprise",
    "features": [
      "API",
      "PersonAccounts",
      "Knowledge",
      "Communities",
      "ServiceCloud",
      "StateAndCountryPicklist",
      "CustomerCommunityPlus",
      "PublishAuraExpBuilderBasedSna",
      "PublishExpBuilderBasedSna",
      "ContactsToMultipleAccounts"
    ],
    "settings": {
        "experienceBundleSettings": {
            "enableExperienceBundleMetadata": true
        },
        "communitiesSettings": {
            "enableNetworksEnabled": true
        },
        "lightningExperienceSettings": {
            "enableS1DesktopEnabled": true
        },
        "chatterSettings": {
            "enableChatter": true
        },
        "pathAssistantSettings": {
            "pathAssistantEnabled" : true
        },
        "accountSettings": {
            "enableRelateContactToMultipleAccounts": true,
            "enableAccountTeams" : true
        },
        "customAddressFieldSettings" : {
            "enableCustomAddressField" : true
        },
        "opportunitySettings": {
            "enableOpportunityTeam" : true
        }
        

    } 
  }
  

sfdx-project.json

{
    "packageDirectories": [
      {
        "path": "force-app",
        "default": true
      }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "55.0"
} 

Account.settings-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<AccountSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableAccountHistoryTracking>false</enableAccountHistoryTracking>
    <enableAccountTeams>true</enableAccountTeams>
    <enableContactHistoryTracking>false</enableContactHistoryTracking>
    <enableRelateContactToMultipleAccounts>true</enableRelateContactToMultipleAccounts>
    <showViewHierarchyLink>true</showViewHierarchyLink>
</AccountSettings>

Opportunity.settings-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<OpportunitySettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <autoActivateNewReminders>true</autoActivateNewReminders>
    <customizableProductSchedulesEnabled>false</customizableProductSchedulesEnabled>
    <doesEnforceStandardOpportunitySaveLogic>true</doesEnforceStandardOpportunitySaveLogic>
    <enableFindSimilarOpportunities>false</enableFindSimilarOpportunities>
    <enableOpportunityFieldHistoryTracking>false</enableOpportunityFieldHistoryTracking>
    <enableOpportunityTeam>true</enableOpportunityTeam>
    <enableUpdateReminders>true</enableUpdateReminders>
    <oppAmountDealMotionEnabled>true</oppAmountDealMotionEnabled>
    <oppCloseDateDealMotionEnabled>true</oppCloseDateDealMotionEnabled>
    <promptToAddProducts>false</promptToAddProducts>
    <simpleOppCreateFromContact>true</simpleOppCreateFromContact>
    <simpleOppCreateFromEvent>true</simpleOppCreateFromEvent>
</OpportunitySettings>
0

1 Answer 1

0

Looks like splits enablement is not currently supported in scratch orgs via SFDX.

Recommend upvoting related ideas: https://ideas.salesforce.com/s/idea/a0B8W00000GdcUxUAJ/opportunity-splits-tracked-in-metadata

https://ideas.salesforce.com/s/idea/a0B8W00000Gdb7rUAB/salesforce-dx-scratch-org-definition-file-should-allow-all-salesforce-settings

You can make use of Org Shape feature

When we use Org Shape, it exactly takes the settings and features from the source org and the Scratch Orgs will be created exactly as a replica of source org implying if opportunity Splits is enabled in the source org, then it is copied over to scratch orgs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .