+ Start a Discussion
ethanoneethanone 

How to pull code into vscode from sandbox?

I used to use the Eclipse Force IDE and I'm switching to VSCode/SFDX. When creating a project in Force IDE, you could specify retreiving "Apex, Lightning, and Visualforce (classes, triggers, test suites, LIghtinging component bundles, pages, Visualforce comonents, and static resources)" 
It appears the -m option of sfdx force:sourc:retrieve could alow for grabbing these same items, but what -m options do I specify? What options are necessary to retrieve new development items (Aura, LWC, etc)?
Raj VakatiRaj Vakati
Refer this links 

https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model
https://wipdeveloper.com/use-sfdx-with-a-sandbox/



https://micropyramid.com/blog/salesforce-source-code-management-with-visual-studio-code-git-and-github/
https://developer.salesforce.com/blogs/2018/10/vs-code-for-salesforce-developers-your-questions-answered.html

http://amitsalesforce.blogspot.com/2018/09/vs-code-for-salesforce-visual-studio.html
ethanoneethanone
These are all great links. Thanks!
One of the trailhead modules suggested that the deployment zip file only encapulated changes, but when I created a simple file, then entire force-app folder was in the zip. Should the zip only have had the one file (simple VF page) in it?
Ajay K DubediAjay K Dubedi
Hi ethanone,
When you created a folder in VS code than you have followed these options that necessary to retrieve new development items (Aura, LWC, etc)
- Make sure you 'Create a project with Manifest' (Not create a  project)
- Authorize an Org (on click this you will have to give access your sandbox to vs code)
- Retrieve Source in Manifest from Org
Then you can get your Org data in your VS code folder and when you will reopen this Without having to re-authenticate it each time.
If you change anything in your org then you can retrieve your data through a manifest(On click on manifest there are a package.xml file,
open package.xml and then on right click you can retrieve your data).
For more information refer: https://www.youtube.com/watch?v=7qR0c8h5cCU
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Vignaesh Ram AmarnathVignaesh Ram Amarnath
Hi ethanone,
You need to modify your package.xml file to retrieve other items. You can use Salesforce Package.xml generator extension for VS Code to do this.It provides an UI like the Force.com IDE to choose metadata needed for package.xml.
https://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator
User-added image