1

I'm trying to understand where the Scratch org gets it's configuration. Some comes from the definition file, but that doesn't contain all default configurations.

In my use case, I have a clean production org with Dev Hub and created a scratch org. If I look at for example the sharing settings they are completely different.

How do I make sure that for example these settings are the same? If I can't, DX is a bit useless since I can't make sure that when I deploy to production everything will still work.

5

Scratch org definitions come from JSON text files that are stored in your project's repository and directory structure. When an SFDX project is first created, it comes with a config/project-scratch-def.json file that defines an extremely basic org "shape" for an empty scratch org.

That default scratch org likely looks nothing like your production org. You can use it for developing functionality that isn't dependent on your org's settings, or you can customize it using the settings that are available as part of the configuration file, or you can script your process to perform Metadata API deploys or other API actions to control settings that DX does not support yet.

Ideally, the combination of your DX source code (including all your programmatic and declarative customization) with your scratch org definition gets you close enough to Prod not to matter.

However, it's possible that isn't enough to get the scratch orgs looking close enough to Prod for your testing to be meaningful. If that's what you need, you should be looking at the Org Shape pilot, an unreleased feature allowing you to create org shape snapshots from real, existing orgs and build scratch orgs on that basis.

  • Wish I could +1 again for Org Shape. – sfdcfox Jun 10 '18 at 6:48

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.