This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Improve handling of self-referencing lookups by force:data:tree commands #248
Labels
feature
Issue or pull request for a new feature
Is your feature request related to a problem? Please describe.
When trying to migrate records using force:data:tree:export and import commands, the import fails on objects which have a self-referencing lookup (i.e. lookup pointing to the same object).
The error is this.
What are you trying to do
I'm trying to migrate records which are in a hierarchy within one object.
Describe the solution you'd like
What I would like to happen is that either the import command saves and resolves references also during import of a single file. In other words, it wouldn't require to save parent records in first import and then the child records in second import.
Or alternatively, I would like the export command which runs a single query on an object with self-referencing lookup to create two (or as many as necessary) separate files for import together with import plan for those files.
Describe alternatives you've considered
I've considered, and made a working prototype of, a script which exports the data in JSON format and from that prepares the files in format usable for force:data:tree:import command. What I would like to avoid is having a custom script to maintain if there is a way the same could be achieved with just Salesforce CLI.
Additional context
I'm happy to add more information on request.
The text was updated successfully, but these errors were encountered: