QuestionQ69

Environments

A developer attempted to retrieve metadata from an org by running the sfdx force:source:retrieve command. When the command ran, the developer received this error message: “This command is required to run from within an SFDX project.”

Which two possible reasons could have caused this issue?

Choose two
  • A The developer hadn’t run the sfdx force:project:create command.
  • B The developer created the project within VSCode, but ran the command in a separate terminal.
  • C The developer created the project, but ran the command outside of the project directory.
  • D The developer forgot to add the -n option with a project name as a command line argument.
Explanation

Salesforce metadata retrieval commands must run within a Salesforce DX project. Creating a project produces the project configuration that identifies the directory as an SFDX project; therefore, either having no project or invoking the command from outside the project directory causes this error. The -n flag specifies package names and does not establish project context.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!