3

Now that Force.com IDE plugin for eclipse is unsupportive, is there any way to connect to Prod org using VS code and download all Apex classes. I can see all extensions for SFDX but I do not know how to connect it for traditional Production Org. Please advise.

1

2 Answers 2

5

To make a connection to production org, follow below steps:-

Open command palette, search for sfdx: Authorize an Org and select it

enter image description here

Now, You will get few options to authorise. You can select Production Org to authorise to a production org:-

enter image description here

Then, VS Code will ask you for an alias name and once you press enter, it will open a browser window to authorise in your production org.

How to retrieve all the apex class from Production?

In your package.xml file, Copy below code:-

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <version>47.0</version>
</Package>

and right click on the package.xml file and select sfdx: retrieve source in Manifest from org

enter image description here

Read more here:-

  1. https://salesforcediaries.com/2019/02/21/setup-your-developer-environment-for-lightning-web-comp/
  2. https://salesforcediaries.com/2019/09/09/xml-package-to-retrieve-metadata-from-org/
3

We can also use these commands from the terminal:

Retrieve All Apex classes

sfdx force:source:retrieve -m ApexClass

Deploy All Apex classes (Never do, a very bad habit)

sfdx force:source:deploy -m ApexClass

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .