3

My boss had been muddling through Salesforce by creating custom objects and triggers using the Lightning Web Interface. I want to pull all his work down in VS Code, commit it to git, and continue development on it. How do I do that? Each sfdx command I run says it requires a project or a manifest.xml file. But I don't know how to create one for code that was created in Salesforce.

3

For SFDX specifically, in VS Code (assuming the Salesforce Extension Pack and SFDX are installed), you can just take the following steps.

First, create a new project (View > Command Palette > SFDX: Create Project With Manifest), enter the project name and the folder name to save it in.

Next, authenticate, if necessary, with (View > Command Palette > SFDX: Authorize an Org), and follow the prompts.

After this, if necessary, set the default user name from the terminal via (Terminal > New Terminal) and entering the command sfdx force:config:set defaultusername=username-or-alias.

Once you have all that configured, continue to use the terminal to retrieve the metadata:

sfdx force:source:retrieve -x package.xml

You'll find all your source in force-app/main/default.


You can customize all this via package.xml and sfdx-project.json to change the metadata to retrieve and/or path settings.

0

Have you tried using workbench? Under the "Migration" tab select "Retrieve" and you can pull down metadata based on an xml package.

https://workbench.developerforce.com/metadataRetrieve.php

Then you build out your package.xml file and use that to determine what types of metadata you want to retrieve. Some examples are here:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.