[EDITED] So, I'm trying to use SalesforceDX to develop. But I keep getting stuck on the configuration. It seems to work fine until I get to the pushing part. I'll post the commands I used.

  • Created a Package on my DevHub org called AutomationC;
  • CD into the folder
  • Went into VS Code and used sfdx force:project:create -n AutomationProj
  • used sfdx force:auth:web:login -a DevHub to authorize the production org
  • retrieved the package with sfdx force:mdapi:retrive -p AutomationC -r ./scrPack
  • extract the files to ./scrPack/AutomationC/*
  • converted with sfdx force:mdapi:convert -r ./srcPck/AutomationC -d ./force-app/main/default. Althoug the files weren't copied to the force-app structure
  • used sfdx force:org:create -v DevHub -f .config/project-scratch-def.json -a devScratch to create the scratch org
  • tried to push the source with sfdx force:source:push --json --loglevel fatal -u devScratch

What followed was a series of errors regarding missing fields or content. I tried using force:mdapi:deploy as well and messing with the order inside the package file to set objects and fileds first, no success.

After the comment of @DavidReed I ran convert without the -d flag the files were copied into the force-app structure. but running the push command I'm still getting errors.

The error says the file was not found. but the apex conde is inside force-app/main/default/classes as it should be

Any help will be appreciated.

  • When you say "files weren't copied to the force-app structure" - what did force:mdapi:convert do? It sounds like it did not find your MDAPI source code. If nothing was copied to force-app, where were the errors located when you ran sfdx force:source:push?
    – David Reed
    Aug 24, 2019 at 13:31
  • You had a point, I executed, from a clean project, the commands removing the -d flag on the convertion, and it worked. But I still get the error, of non existing objects Aug 27, 2019 at 12:26

1 Answer 1


Figure it out. I was missing a command, and some flags:

For example, the -d flag, to make the devHub my default org was missing. Also, the force:source:convert command was not in my list. after that all worked as it should.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .