Deploy Salesforce Package Using Visual Studio Code

1.9k views Asked by At

I am new to developing for Salesforce. I have installed the Salesforce Extension Pack for Visual Studio Code. So far I have been able to create a project, authorize an org and deploy a single Apex class to a Salesforce Trailhead org.

Where I'm stuck is being able to deploy the entire package to my Salesforce org instead of just a single class. I followed the Trailhead Visual Studio Code training but it ends at deploying just a single Apex class. I've search but can't find anything that answers my question.

2

There are 2 answers

1
Rajat Jaiswal On

First you have to create Project with Manifest in Vs Code . After the update add all the class and other things to Vs code . Now update the package.xml file . You got in force-app in vs code. After then you can deploy it to org by clicking on right button .

0
MikeA On

You can right click your package file in the Explorer and select 'SFDX Deploy Source in Manifest to Org':

enter image description here

Alternatively, deploy from the command line with

> sfdx force:source:deploy -x path/to/package.xml

You can check docs for the CLI commands here:

https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_force_source_deploy