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
Kaustubh LabheKaustubh Labhe 

VSCODE: Create Project vs Create project using manifest

Hi,

Can someone tell me, what is the difference between Create Project and Create Project using Manifest? 
Is the latter used for non-dx projects primarily?

Thx
Alain CabonAlain Cabon
Hi,

Create Project  is an empty project with only the folders.
  1. Choose an existing folder for your project on disk 
  2. CTRL + Shift + P : SFDX: Authorize an Org
  3. Enter an alias of this org ( here TESTING2 )
  4. Enter your credentials ( user / password )
  5. Terminal (tab):  type the next command lines directly
    1. sfdx force:source:retrieve -m ApexClass
    2. sfdx force:source:retrieve -m AuraDefinitionBundle

Create Project using Manifest => "manifest" folder contains a default package.xml
  1. Choose an existing folder for your project on disk
  2. CTRL + Shift + P : SFDX: Authorize an Org
  3. Enter an alias of this org ( here TESTING2 )
  4. Enter your credentials  ( user / password )
  5. Right click on package.xml
  6. SFDX: Retrieve Source in Manifest from Org
User-added image

 
Kaustubh LabheKaustubh Labhe
Hi,

Thx for the reply. So in manifest, you get the package.xml, but you can edit that package right? and include more tags in it?
But i dont get the fundamental difference like! 

Thx
Alain CabonAlain Cabon
Hi,

Yes of course, you can add all the metadata types if you don't have many objects.

Some metadata types accept the wildcard character (*) but not all like the reports or the dashboards (rarely modified under the xml format).

List of all the metadata types :
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_types_list.htm

MavensMate (former tool, obsolete now) built a complete package.xml by selecting the metadata type (checkboxes) but that is not possible with VS Code.

There is a limit for the number of objects retrieved at 10,000 max. ( that is possible when you want to have all the reports and dasboards for instance).

The minimum package.xml for a developer should have: the apex classes, the triggers, the visualforce pages, the aura bundle definitions (lightning) and the ligtning web component (lwc).

But you can have also the layouts, the objects with their fields and so on.

For each metadata type that you want you have always a sample in the documentation like below: 

Declarative Metadata Sample Definition
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>45.0</version>
</Package>

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_lightningcomponentbundle.htm

You can add dozens of lines like this following one in package.xml if the total of objects retrieved is under 10,000 and if the wildcard character (*) is allowed.

<types> <members>*</members> <name>LightningComponentBundle</name> </types>  
 
Alain CabonAlain Cabon
Hi,

Salesforce package.xml Builder
https://packagebuilder.herokuapp.com/

Auto-Generate package.xml for Salesforce Application Development and Deployment​​​​​​​
https://www.codescience.com/blog/2018/auto-generate-package-xml

I have created my own generator for package xml in java but the result could be quickly very huge and exceed the 10,000 objects.
A big package xml is also very long to download completely.

The standard defauit package xml for VS Code is very good for a developper (apex code, aura lightning and lwc).
 
Ajay K DubediAjay K Dubedi
Hi Kaustubh,

As per official vsCode documentation "If you are developing against non-source-tracked orgs (sandboxes, DE orgs, or Trailhead Playgrounds),
use the command SFDX: Create Project with Manifest to create your project. If you used another command, you might want to start over with that command."
This statement clearly states that while dealing with above mentioned orgs you must use Create project with manifest as unlike Create Project,
Create Project with Manifest allows the pull/push operation i.e SFDX: Deploy Source to Org and SFDX: Retrieve Source from Org.
Therefore If you want to download all the codes and metadata from a Salesforce environment you must use Create project with manifest.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Vignaesh Ram AmarnathVignaesh Ram Amarnath
Now you can add metadata components to package.xml file (just like you did using Eclipse Force.com IDE) at the comfort of VS Code using this extension. No need to manually edit package.xml. It works seamlessly with the Salesforce extensions for VS Code , so you do not have to login again. Please do try out this Visual Studio code extension.
https://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator
Salesforce package.xml generator for VS Code
Alain CabonAlain Cabon
@Vignaesh Ram Amarnath : you have created a great generator extension for VS Code.

Salesforce Package.xml Generator Extension for VS Code   Version1.0.1
Released on: 08/05/2019     Last updated 16/05/2019 
Publisher Vignaesh Ram A
https://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator

I used it now and that works fine!

Very useful and easy to use.
Vignaesh Ram AmarnathVignaesh Ram Amarnath
Thanks @Alain Cabon:) Glad you liked it..Please do spread the word.:)
Pavlin Penchev 10Pavlin Penchev 10

This is a useful discussion! I followed the steps and managed to retrieve data from my org but I can't figure out how to edit (and find in the first place) the Article Content component that displays Salesforce Articles (part of the Knowledge product) on Communities/Sites. I need access to the HTML and JavaScript, I think, to tweak the behaviour of images displayed as part of the 'Article Content' component. I am not finding the component in question under the LWC folder, nor anywhere else (components, pages folders etc). Is this possible at all?

User-added image