Skip to main content

Visual Studio Code Setup for Salesforce




This Article explains the initial setup of the VS Code, to start coding in your sandbox or prod org. You will be able to create a component and save back to the org from this article.

Step 1) Install VsCode. Click here to download.(Please use 1.24 version)

Step 3) Install the Salesforce Extension for VS Code. and "ForceCode" Extensions.







Step 3) Restart the VS Code.
                NOTE: To run all the commands use ctl+shft+P

Step 4) Run below command to create new project with manifest
1.       sfdx: create project with manifest
2.       Enter Project name and select folder path.
3.       NOTE: Don’t use space in Name, you may need to run this command multiple time it doesn’t work.

Step 5) Run below command to connect you project to org
1.       sfdx: authorize an org
2.       Select if it is Prod or Sandbox
3.       follow the instructions on the screen.

Step 6) Set connected org to default, using below command
1.       sfdx: set a default org
2.       If you have multiple org connected before, you need to select specific org here.

Step 7) Retrieve components from the org.
1.       On left side of the window, you will see Manifest folder, expand it to see package.xml
2.       It is default xml, edit it or keep It as it is.
3.       From left side window, right click on package.xml and click ‘retrieve source from org’
4.       It will retrieve all metadata from the org that is connected

Step 8) To create new components
1.       On left side inside ‘main’ folder, there will be default folder.
2.       You will see all the components in this folder.
3.       To create new component, right click on the folder (e.g ‘classes’), and run appropriate command form the list (e.g create apex class).

Step 9) Once you create new component or edit existing, you need to deploy the component to save it back to the org.
1.       Deploy all metadata
a.       Right click on package.xml file and run deploy command.
2.       Deploy specific component
a.       Open the component in the editor ( e.g TestClass.cls)
b.       Right click on editor and run deploy command.


Comments

Popular posts from this blog

Salesforce lightning component e.force:navigateToURL

This article will explain how to use ‘e.force:navigateToURL’ lightning component to navigate the system to any URL (visualforce page, record, any custom URL). Syntax of ‘e.force:navigateToURL’ var urlEvent = $A.get("e.force:navigateToURL");         urlEvent.setParams({           "url": "/" + recordId ,             "isredirect": "true"         });         urlEvent.fire(); Description of the parameters, 1.        URl – Set this parameter to the required URL that you want to redirect, in this example ‘recordId’ is my variable with has the Id of the record I want to redirect. We can use static URL (e.g https://www.salesforce.com ) as well. 2.        Isredirect – This is optional, this flag will not...

Best practices for Data Loading in Salesforce

Data loading is a very common requirement in most of the salesforce projects. We need to load many master data and transactional data in production based on requirements that include thousands of records. In this article, I am going to list some best practices that we can follow and keep in mind while loading data in production. 1.     Organization-Wide Sharing defaults - While loading data in production, if objects have ‘Private’ OWD then it does additional processing in the background. Therefore, it is better to load data using read/write OWD and change it to ‘private’ after cutover. 2.     Workflow rules, validation rules, and triggers - If these tools are enabled in your production org while loading data, it can give many errors and it may slow down the process. Therefore, it is recommended to disable these tools before loading data.   3.     Bulk API Vs. SOAP API - SOAP API is useful for small data sets where...

How to start with salesforce

'Salesforce' is cloud computing company, which provides many services and uses many technology to deliver services. Salesforce is high demanding cloud computing technology that provides 'PAAS' to create your application on cloud and deliver to users.  But how to start with salesforce. This article will provide you basic idea to start with Salesforce if you are new to this technology.  If you are a developer, it will be very easy to jump in Salesforce technology and master it. How Salesforce is useful to deliver solution: Salesforce platform will help you to deliver CRM Applications. You can build CRM applications which can be used by businesses to track sales activity. Salesforce Platform is employed across all industries to build and launch game changing apps for every department in a company, including HR, IT, operations, finance, legal, and marketing.  Here is the example of some applications that you can build with help of salesforce. ...