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
fiona gentryfiona gentry 

How To Import Apex Classes Dev Sandbox into Visual Studio Code After SFDX: Authorise Org

Hi Gurus,
How do i  Import Apex Classes Dev Sandbox into Visual Studio Code After successfully doing  SFDX: Authorise Org for my dev org which is a scratch org sandbox, basically I would like to execute my apex unit tests from Visual studio code..but the problem is I see only LWC project got created with project.json file  ..Here is my VSCode

User-added image

Regards,
Fiona
Best Answer chosen by fiona gentry
sachinarorasfsachinarorasf
Hi <fiona>,

After successfully doing  SFDX: Authorise Org, Please follow the following steps :
Step 1: Go to the Manifest folder in your created project.
Step 2: Right-click on the package.xml file.
Step 3: Select the' Retrieve source in Manifest from org' option from the drop-down list.
After successfully retrieved the source file, you can find the Apex classes in the 'force-app' folder.

I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com

All Answers

sachinarorasfsachinarorasf
Hi <fiona>,

After successfully doing  SFDX: Authorise Org, Please follow the following steps :
Step 1: Go to the Manifest folder in your created project.
Step 2: Right-click on the package.xml file.
Step 3: Select the' Retrieve source in Manifest from org' option from the drop-down list.
After successfully retrieved the source file, you can find the Apex classes in the 'force-app' folder.

I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com
This was selected as the best answer
Doris Gammenthaler-Vivero 14Doris Gammenthaler-Vivero 14
The SF tutorials don't mention the manifest. I'm not creating new classes, I need to work on existing code. This was very helpful, the missing piece.
Ramon Schneider 5Ramon Schneider 5
At first I didn't see the manifest folder, but creating the project anew in VSCS with the option SFDX: Create Project with Manifest instead of SFDX: Create Project solved it for me together with sachinarorasf's answer.
Jean-Francois CarrierJean-Francois Carrier
I'm currently trying to import some Apex classes from a package without success. I've tried to put the package information in my package.xml but it's still impossible to retrieve my class from my org to my visual studio code project. Do you have any solutions for that? If I'm not wrong, it's supposed to work. I can see all the code from the developer console, so the class should be accessible.