So i am trying to automate some of the data tasks and Export data from an org to be imported into scratch orgs on creation.
The records I am trying to export have record types. The record types are associated with a managed package
When I perform the following to get the data out of the org (Following this example) I get an error
sfdx force:data:tree:export -u SOURCE -q "Select Id, Name, RecordtypeId From OBJECT" --prefix export-demo --outputdir sfdx-out --plan
However I get the following error
ERROR: Reference RecordType not found for RecordTypeId. Skipping record undefined.
As expected when I remove the RecordTypeId from the query it works, but I need to have this value, preferably by name and not Id since the Ids will be different in different orgs.
So how does one automate the export and loading of data when record types exist. Is it possible to do so without editing the file every time to add the recordtypeIds?
Per sfdxfox comment, I tried with RecordType.Name and the records exported but then when I went to import into the new org I got:
INVALID_FIELD Cannot reference a foreign key field RecordType.
So I got the records but was unable to import them.
Hoping there is some way to automate this across scratch orgs or the data loading part to repopulate data in an org is useless for me at least because everything has record types....