Capgemini / Capgemini/xrm-datamigration-xrmtoolbox

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

Open
#98 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
10
Forks
4
PR merge metrics
No merged PRs in 30d

Description

**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" `

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the export with an out-of-the-box self-referential many-to-many relationship in CDS Data Migrator, then compare its behavior with the base configuration migration tool. Inspect how the export handles the schema parameters `manyToMany="true"` and `isreflexive="true"`, and verify that the linked records and relationship are represented correctly in JSON.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.