Skip to main content

Does anyone how to export / import lookup relationships with sfdx cli ?

I have successfully exported / imported account and contacts since they are in MD relationship but how do I export a lookup relationship

 

I am using sfdx force:data:tree:export and sfdx force:data:tree:import with the plan option

In the SOQL if I have SELECT Account__c FROM XXX I get in the export

Reference Account not found for Account__c.  Skipping record undefined

 

If I have Account__r.Id in the export, the export works but in the import I get

{"statusCode":"INVALID_FIELD","message":"Cannot reference a foreign key field Account__r.","fields":[]}

same error if I use an external field

 

Account__c is a lookup field and the accounts are already imported to the org

 

Exporting / Importing MD relationships works find

3 comentários
  1. 29 de abr. de 2020, 14:28
    Thanks, I will give the npm package a try. I find it quite remarkably that a normal lookup relationship with dot notation does not work in the standard cli.
0/9000