3

I'm using DX to push my metadata from an existing org to a scratch org. I have no idea how to resolve this errors and I have looked online but no help and also I looked someone posted here but did not help me either.

Here is what I'm doing:

First I retrieve the metadata from my developer org (existing one) Export the unmanaged package metadata in a temporary directory.

sfdx force:mdapi:retrieve -s -r ./temp -u mydevorg -p mypackage

Convert the source code to the Salesforce DX project structure:

sfdx force:mdapi:convert -r ./temp

Create a scratch org:

sfdx force:org:create -s -f config/project-scratch-def.json -a myscratchorg

Push the code to scratch org:

sfdx force:source:push -u myscratchorg

PROJECT PATH                                                                                         ERROR
───────────────────────────────────────────────────────────────────────────────────────────────────  ────────────────────────────────────────────────────────────────────────────────────────
force-app/main/default/layouts/OpportunityTeamMember-Opportunity Team Member Layout.layout-meta.xml  Parent entity failed to deploy
force-app/main/default/profiles/Certification User.profile-meta.xml                                  invalid cross reference id
force-app/main/default/profiles/Finance User.profile-meta.xml                                        invalid cross reference id
force-app/main/default/profiles/General Marketing User.profile-meta.xml                              invalid cross reference id
force-app/main/default/profiles/HR Contractor Users.profile-meta.xml                                 invalid cross reference id
force-app/main/default/workflows/Course_Delivery__c.workflow-meta.xml                                Cannot delete a workflow object; Workflow Rules and Actions must be deleted individually
force-app/main/default/profiles/Professional Services Manager.profile-meta.xml                       invalid cross reference id
force-app/main/default/profiles/Sales User.profile-meta.xml                                          invalid cross reference id
force-app/main/default/profiles/Support User.profile-meta.xml                                        invalid cross reference id
force-app/main/default/profiles/Training User.profile-meta.xml                                       invalid cross reference id
force-app/main/default/profiles/Instructor User.profile-meta.xml                                     invalid cross reference id
force-app/main/default/workflows/Course_Delivery__c.workflow-meta.xml                                Cannot delete a workflow object; Workflow Rules and Actions must be deleted individually
  • Can you share your scratch org def file ? But quickly like this : 1) make sure IsOpportunityTeamEnabled is enabled. 2) There is also some known issues with profiles, you must enable hasSampleData. – Cloud Ninja Apr 3 '18 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.