Scratch Org Feature not Enabled using Org Shape
See original GitHub issueSummary
When using the Org Shape (beta) feature, sometimes the ContactsToMultipleAccounts
feature from the source org isn’t enabled in the target scratch org.
Steps To Reproduce:
- Create an Org Shape from an Org that has the
ContactsToMultipleAccounts
Feature enabled - Create a new SFDX Project and use the Org Shape in the
project-scratch-def.json
:
{
"orgName": "bug-org",
"sourceOrg": "00Dj0000000SOURCEORGID"
}
- Create a scratch org using the CLI:
sfdx force:org:create -f config/project-scratch-def.json -a feature-bug
Expected result
When the scratch org is created, it has the ContactsToMultipleAccounts
Feature enabled and allows pushing code that relies on this feature (Presence of the AccountContactRelation
object exists)
Actual result
Sometimes the feature is enabled, and sometimes it isn’t. It’s not clear when it is or is not enabled in the Scratch Org. In come cases:
- The UI and the
Account.settings
metadata will indicate the setting is enabled, but pushes will fail (lack ofAccountContactRelation
Apex class) - The UI and
Account.settings
metadata indicate the feature is NOT enabled, (pushes also fail) - The UI and
Account.settings
metadata indicate the feature is enabled, AND pushes work
We observe the issue each time when we try to push Apex code into the org that relies on the AccountContactRelation
object that only exists when this feature is enabled and the push fails.
The issue seems to present itself randomly. More than half of the scratch orgs we create in this way are unusable. We only started to see this issue a few weeks ago following the Spring '21 release of SalesForce.
Additional information
SFDX CLI Version(to find the version of the CLI engine run sfdx --version): 7.85.1
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core): salesforcedx 50.15.0 (core)
OS and version: Observed on developer systems: MacOS Catalina 10.15.7, Windows 10, and CI/CD server: Alpine Linux docker image
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (1 by maintainers)
For anyone interested there are 2 Known Issues about it, one for Org Shape here, and a second one for Scratch Org here (because the issue is actually not limited to Org Shape).
This is a known serverside issue and the appropriate team is tracking internally with W-9529783 and W-9604466. Since this is not an issue with the CLI I’m closing this issue. Feel free to contact support for anything addtional.