Loading

Salesforce Project in Visual Studio Code and Searching for Hard-Coded References

Udgivelsesdato: Oct 13, 2022
Beskrivelse

At a high level, Salesforce Extension for Visual Studio Code includes tools for developing on the Salesforce platform which replaces the deprecated Force.com Plugin for Eclipse. An IDE, or integrated development environment, typically consists of a code editor, build automation tools, a debugger, and intelligent code completion.

Løsning
Creating a Salesforce project in Visual Studio Code:
  1. Open the VS Code editor and from the Command Palette, run SFDX: Create Project with Manifest.
  2. Run SFDX: Authorize an Org and select a login URL, for example Production.
  3. After you provide an org alias, a browser window opens. Allow access, log in to your org, and then return to the VS Code window. The Org Picker now shows the alias provided while authorizing the org.
  4. When you run SFDX: Create Project with Manifest command, a package.xml file is created. Add the various metadata types you want to retrieve to this file. To understand how to work with different subsets of metadata in package.xml file, see Sample package.xml Manifest Files in the Metadata API Developer Guide.
  5. In VS Code explorer or editor, right-click a manifest file and select SFDX: Retrieve Source in Manifest from Org. This will retrieve the components from the authorized org based on the components defined in the package.xml

Searching for a Keyword in the Project:
  1. Once the components are retrieved based on above steps, do a Command + Shift + F on Mac or Control + Shift + F on Windows to search for a Hard-Coded reference in the code base. 
Considerations : 
  1. As a prerequisite, please make sure to install Visual Studio Code and Salesforce Extension Pack.
  2. You can also use Org Browser without having to use a manifest file.
  3. Also above steps works for non-scratch orgs. To work with scratch orgs, please use force:source:pull instead.
Vidensartikelnummer

000381316

 
Indlæser
Salesforce Help | Article