In this post we will talk about how to setup VsCode for salesforce. We can use the VsCode with ForceCode Extensions or with SalesforceDx. If you want to learn about SalesforceDX for Non-Scratch Org check this post.
Option 1) VsCode With SalesforceDX :-
If you want to setup VsCode with salesforceDx. Check this recording.
After watching above recording you will able to perform below activity.
Option 2) Setup VS Code with ForceCode Extension :-
Step 1) Install VsCode. Click here to download.(Please use 1.24 version)
Step 2) Install SFDC CLI https://developer.salesforce.com/tools/sfdxcli
Step 3) Install the Salesforce Extension for VS Code. and "ForceCode" Extensions.
Step 3) Restart the VS Code.
Step 4) Click on File --> Open Folder--> Select your folder which you want to use.
Step 5) Press "CTL+SHIFT+P" then Type "ForceCode Menu"
Step 6) Enter User Name and password.
Step 7) Then Import the project by "Get All Files from org" or "Package.xml" option
Reference Link :-
1) https://developer.salesforce.com/blogs/2018/02/salesforce-extensions-vs-code.html
Thanks,
Amit Chaudhary
@amit_sfdc #SalesforceApexHours @ApexHours
Salesforce Apex Hours
Option 1) VsCode With SalesforceDX :-
If you want to setup VsCode with salesforceDx. Check this recording.
After watching above recording you will able to perform below activity.
- Install VsCode from here.
- Install Salesforce Extension
- Salesforce Extension Pack
- Lightning Web Components (If you want to use LWC)
- Create project with non Scratch Org
- How to create Apex Class
- Execute Test Class
- To retrieve code coverage results when you run Apex tests, edit your workspace settings and set salesforcedx-vscode-core.retrieve-test-code-coverage to true.
- Execute Anonymous Apex with Editor Contents
- Execute SOQL
- Debug log in VsCode
Option 2) Setup VS Code with ForceCode Extension :-
Step 1) Install VsCode. Click here to download.(Please use 1.24 version)
Step 2) Install SFDC CLI https://developer.salesforce.com/tools/sfdxcli
Step 3) Install the Salesforce Extension for VS Code. and "ForceCode" Extensions.
Step 3) Restart the VS Code.
Step 4) Click on File --> Open Folder--> Select your folder which you want to use.
Step 5) Press "CTL+SHIFT+P" then Type "ForceCode Menu"
Step 6) Enter User Name and password.
Step 7) Then Import the project by "Get All Files from org" or "Package.xml" option
Reference Link :-
1) https://developer.salesforce.com/blogs/2018/02/salesforce-extensions-vs-code.html
Thanks,
Amit Chaudhary
@amit_sfdc #SalesforceApexHours @ApexHours
Salesforce Apex Hours
thank you so much !!
ReplyDeleteThanks Amit. You can also use Salesforce package.xml generator vs code extension to choose metadata using point and click like in Force.com IDE plugin.
ReplyDeletehttps://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator
Thanks Amit. I was able to get the development started in VSCode thanks to your blogpost today.
ReplyDeleteHi Amit. Thanks for the post. I tried the above steps, all components got exported to xml except lWC Components. Could you please help me to export lwc components as well.
ReplyDeleteCan you please share your package.xml file ? I hope you added LWC Component and version is 45 ?
DeleteI have follwed all the above steps but its keep on asking me Error: "ForceCode: the SFDX cli is not found"
ReplyDeleteDid u get any solution for this , i am also facing the same issue
DeleteSalesforce CLI is installed in my system and extension pack is also there and path is set properly still m getting this error again and again
DeleteHi Amit,
ReplyDeleteI installed Vs Code connect the org and I get all source code from sandbox but next day i opened come check Try retrieve the code Got an Error "cannot read property 'parent' of undefined" .
Please tell me the suggestion.
Thanks and Regards,
Kamesh
stunning and brave
ReplyDeleteHi, I don't see "Get All Files from org" option. Which extension it comes from?
ReplyDeleteI tried retrieving using package.xml. That does not work. It says "Either the file/metadata type doesn't exist in the current org or you're trying to save/retrieve outside of c:\Users\Downloads\C Drive\Dev1\src
ReplyDeletehow to validate the vs code
ReplyDeleteHi Amit,
ReplyDeletemaybe you can help me. When I'm running test classes in VS code, got different coverages in each time, or the classes that the test passed are not showned all...you have any idea about the root cause? Thank you.
How to compile all classes in vs code?
ReplyDeleteNice Blog...! It is really useful for me and I expect from you more updating about this title. Thank you!!!
ReplyDeleteSpousal Support in Virginia
Virginia Spousal Support
Such a wonderful post and this is really helpful for me. Thank you!
ReplyDeletepvc foam board manufacturers in kerala
Such a useful blogs and must be helpful
ReplyDeleteHow Many Points Is Reckless Driving in Virginia
virginia military divorce
Great Article and very informative as well
ReplyDeleteformularios de divorcio no disputado en virginia
Abogado Trafico Fairfax Va
This piece does a fantastic job of simplifying a complex subject. I genuinely appreciate how the writer made it so easy to understand. Great work! Visit our link for ISO Certification in Saudi Arabia
ReplyDelete