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
Dev_AryaDev_Arya 

scratch org from developer sandbox

Hi All,

We are trying to setup SalesforceDX in our company and I am stucked with a very basic understanding of the SalesforceDX architecture.
So Far we have Developer Sandbox for every developer. But from now on, we wish to have one developer sandbox and developers must create scratch orgs from this Developer Sandbox and when developer is done testing on QA Sandbox, then the changes are pushed to the production org.

In my understanding, to create a sratch org, user needs to login with Devhub org which is the production org. Every developer then needs to login with production login first to create the scratch org and then push the changes to VCS? Is my understanding correct here? If Devhub is enabled, why cannot we create scratch org from the developer sandbox? Could somebody explain the architecture? I tried to understand from different blogs but didnt get any substantial answer.

Thanks. Dev
Menand ModhavadiaMenand Modhavadia
@Dev_Arya

Hi 

i am new in salesforce development. i don't know what is salesforceDX.Please explain flow of this and how to used this in scratch.

Thanks
Menand 







 
Pavit SiddhuPavit Siddhu
https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components
Cherish Reddy 17Cherish Reddy 17
Hi SFDC Batch28,
I had faced the same issue. So what I did was:
1) check-in ur terminal of Visual studio code : sfdx force:org:list --all and see which all are authorized org and search for D next to it. Here D refers to as flag for Dev Hub and see to that you have only one D flag
User-added image
 
2)check if you have enabled Dev hub for the D flag authorized org. If not first log in to that org and go to Setup > quick find > search for Dev Hub > Click on Dev Hub > Enable it as shown in the screenshot below. 
User-added image

3)Always remember that whenever you are dealing with Visual studio code and Salesforce CLI topics in trailhead, you need to authorize and login only with your newly created Trailhead Playgrounds (note: create one and use it for all the VSC topics) not with the developer account that you have.
User-added image

4)Now when all this is done. You can sfdx force:org:list --clean to clean all the previous expired scratch orgs.

5)Now give the scratch org command sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch and check. You will get the success message as seen below. 
User-added image

If you think I answered your question then please mark this as the best answer and share. I am in learning process so I maybe wrong. But this way it helped me to create scratch orgs.