• Corey Cummings
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 3
    Replies
I have followed the instructions for creating a sfdx project locally and converted all of my metadata to the sfdx format. Now I want to push my local meta data to my scratch org but I receive a huge list of errors. Most of them are that the objects are different and items don't exist, which I know because it's the first time I want to push my local version to the scratch org so my scratch org matches my production/sandbox metadata.Has anyone had this problem and have any advice to how to deploy my local set of metadata to a scratch org? I tried to use the --forceoverwrite parameter on sfdx push, but I still receive a LOT of errors such as invalid type, field does not exist, etc. I would think this command would overwrite what is on the scratch org with what I am pushing to it. Thanks for any advice
I have followed the instructions for creating a sfdx project locally and converted all of my metadata to the sfdx format. Now I want to push my local meta data to my scratch org but I receive a huge list of errors. Most of them are that the objects are different and items don't exist, which I know because it's the first time I want to push my local version to the scratch org so my scratch org matches my production/sandbox metadata.Has anyone had this problem and have any advice to how to deploy my local set of metadata to a scratch org? I tried to use the --forceoverwrite parameter on sfdx push, but I still receive a LOT of errors such as invalid type, field does not exist, etc. I would think this command would overwrite what is on the scratch org with what I am pushing to it. Thanks for any advice
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs.