+ Start a Discussion

Import Apex Classes and Triggers from Sandbox into Visual Studio Code / Salesforce DX

I'm struggling to understand how to pull triggers and a apex classes FROM a sandbox using visual studio code / salesforce dx. I'd like to pull triggers down from an org to edit them in a batch but can't find the method to do that. I've looked around at documentation but I've struggled to find anything that would allow me to do this specifically.
Ashish DevAshish Dev
Hi Will,
I would recommend to refer trailhead (https://trailhead.salesforce.com/trails/sfdx_get_started/modules/sfdx_app_dev/units/sfdx_app_dev_deploy) for help on this. Specifically you need to prepare package.xml file and retrieve the components.

Let me know if this helps you.
Viktor IvanovViktor Ivanov
For me worked, when my profile was changed to "System Administrator".
Or this field must be checked (as I think).
User-added image
After that, it would be good to reload Visual Studio Code.
Than, if you retrieve only classes, it didn`t worked for me.
But, when I retrieved all data, it worked for me. (manifest folder > right click on package.xml)
User-added image
Hope, that it will help ^^)
You can retrieve specific metadata components using the below vs-code extesion: