Capgemini / xrm-datamigration-xrmtoolbox

Export and import data for Microsoft Dataverse as an XrmToolBox plugin. Supports JSON and CSV.
MIT License
8 stars 4 forks source link

Data Migrator does not work with self referential many to many entity relationships #98

Open Zwuai opened 6 months ago

Zwuai commented 6 months ago

Describe the bug If an out of the box N:N relationship is set up between a table and itself, the data migrator cannot export it, as it assumes the primary key for records will always be "schema name" + id, but with self referential N:Ns the primary key on the link table is is "schema name" + "schema name" + id, with the guids of the two records to be linked stored as "schema name" + idone and "schema name" + idtwo.

To Reproduce Create an OOB self referential many to many relationship between a table and itself. Add this relationship to the schema in CDS Data Migrator. Attempt to export data using the schema.

Expected behavior CDS data migrator should export the records with the relationship and model it correctly in JSON.

Additional context This is something that the base configuration migration tool handles so we have been using that just for this one table relationship and CDS Data Migrator for everything else. I assume these parameters in the CM schema are used to manage this scenario: manyToMany="true" isreflexive="true"