When you are working on a perfectly "independent" feature, Salesforce DX development model and the pratices described in the Trailhead makes perfect sense.

Once you release a feature A, you might then need to work on feature B that depends on A. Therefore you would not really need a scratch org but something that is more similar to a Sandbox or at least a Scratch Org + A.

How do you handle those cases in Salesforce DX?

  • If these are features, wouldn't they be in the same project repo? Or are these like optional add-ons for a paid app? Different scenarios have different answers. – Mike Chale Oct 10 '17 at 0:38
  • Good question. I guess since they are related they will go in the same repo, therefore you won't have 1 repo per feature but 1 repo per related group of features – Edmondo1984 Oct 10 '17 at 6:31

You can still use DX . DX does not mean only working with Scratch org .In DX your Source is a version control system .

So you will have your code in the git repository or an equivalent VCS system and you will create one more branch called feature branch .

Now feature branch can be pushed to the Scratch org and once you build the feature pull into your local machine and then move that to version control .

You will eventually merge feature to the master branch .Also note there is no harm in working with Sandbox using DX .DX provides metadata API convert , retrieve and deploy commands if you want to push code to sandbox or PROD instance.

  • This is not exactly what I was asking for. My question is : how do I bootstrap a Scratch org for feature B, since I also need feature A to be deployed on the scratch org? – Edmondo1984 Oct 9 '17 at 9:32
  • If you already have your feature A in your repo, you should just push your metadata from your repo to your scratch org and be ready to go – Fabien Taillon Oct 10 '17 at 8:30
  • @Fabien Not sure how my answer makes no sense to questionare.This is so clear . – Mohith Shrivastava Oct 10 '17 at 12:32
  • 2
    @Edmondo1984 All DX development is done in scratch orgs. You would just push the code for Feature A into the scratch orgs when developing B. – Mike Chale Oct 10 '17 at 12:39
  • 1
    Customizations are part of metadata in source code .There are commands to retrieve or convert from metadata api – Mohith Shrivastava Oct 11 '17 at 14:28

Long term, you’ll solve this by creating multiple packages and specifying dependencies across the packages.

For now, I recommend you look at multiple package directories in the same project. This will help you start to organize your metadata, yet in the context of your scratch org you’ll have everything you need.

  • Can you provide some details? – Edmondo1984 Oct 16 '17 at 12:42

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.