function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prashant Hirapara 3Prashant Hirapara 3 

Scratch Org : How to enable account & opportunity Team Settings

I have a large existing metadata from an org which we want to convert it to SF DX project. So far we have successfully converted the metadata from an existing org to the SF DX Project structure .

When i push the code to Scratch Org I am getting tons of issues and a lot of them are pointing to enabling Account & Opportunity Team Settings as shown below.
AccountTeamMember error in scratch org.

If i manually enable this in Scratch Org and push the code thereafter it works fine. However my goal is to automate these with Continous Integration where we will be creating the Scratch Org on the fly and pushing the existing metadata to it.
 
Best Answer chosen by Prashant Hirapara 3
Gabriel C FerreiraGabriel C Ferreira
Add this to your Scrath Org Definition File:
"settings": {
      "AccountSettings": {
          "enableAccountTeams": true
      },
      "OpportunitySettings": {
          "enableOpportunityTeam": true
      }
  }
You can find more options here:

AccountSettings: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_accountsettings.htm
Opportunity Setttings: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_opportunityssettings.htm
Metadata Coverage: https://developer.salesforce.com/docs/metadata-coverage/46/OpportunitySettings/details
Scratch Org Def File Help: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file_config_values.htm

If it helped solve your issue, please mark as the best answer.
Best Regards.

All Answers

Gabriel C FerreiraGabriel C Ferreira
Add this to your Scrath Org Definition File:
"settings": {
      "AccountSettings": {
          "enableAccountTeams": true
      },
      "OpportunitySettings": {
          "enableOpportunityTeam": true
      }
  }
You can find more options here:

AccountSettings: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_accountsettings.htm
Opportunity Setttings: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_opportunityssettings.htm
Metadata Coverage: https://developer.salesforce.com/docs/metadata-coverage/46/OpportunitySettings/details
Scratch Org Def File Help: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file_config_values.htm

If it helped solve your issue, please mark as the best answer.
Best Regards.
This was selected as the best answer
Prashant Hirapara 3Prashant Hirapara 3
Thanks Gabriel. It did fix my issue and now the my errors have reduced pushing the metadata to Scratch Org. Since you helped me fix this issue and if you don't mind me asking. How can you enable Opportunity Split and push it part of metadata?