Skip to main content

Hey everyone,

 

I'm planning to move from Chain-Set Deployment approach to Org Development Model which can provide more flexible and scalable environment for development. Also it can provide source tracking in Version Control System such as Github. When I download the metadata from my Production Org and zip the folder, I try to deploy the zip folder to a fresh created scratch org with command `sfdx force:mdapi:deploy`, however, many errors prop out.

 

Most errors are related to the objects in managed packages are not found and namespace in those packages cannot be recognized. I have purchased and installed several managed packages and I've used some of the objects in those packages in my own triggers. So how could I include those managed packages in the metadata that I used to deploy to a scratch org or another sandbox?

 

The second type of errors are the Opportunity access level below the organization default when I try to deploy Role. I have changed the Opportunity access level to Private in my Production Org, however, I checked that the fresh created scratch org with default access level Read/Write. How could I set the default access level of Opportunity to Private instead of Read/Write when I create the scratch org? Or the Org Development Model approach is not recommended to use scratch org for first stage testing in the CI/CD pipeline?

 

Best regards,

Angus

1 comment
  1. Jan 22, 2021, 7:16 AM

    Hi Angus,

    First of all don’t use deploy/retrieve in a scratch org, use push and pull instead.

    Regarding the issues you have with the managed package, I use a bash script to create a new scratch org, install the needed managed package and perform all the operation needed before I push the changes to the scratch org.

    I suggest to check this repository

    https://github.com/trailheadapps/lwc-recipes , the script you have to check is in the bin folder named install-scratch.sh
0/9000