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

Handle composite keys when choosing lookup data #100

Open markduk opened 2 weeks ago

markduk commented 2 weeks ago

Problem

Certain reference data in our system has the same name and is distinguishable via a second field (Company). I have no control over this. As an example we have the table Reason Code:

Name Company
Reason1 Food
Reason1 Liquor
Reason2 Food
Reason2 Liquor

We have a table (ReasonCodeOrder) that has a lookup to Reason Code, this table also has a Company field (lookup). Our UI restricts the selection of ReasonCodes to only allow ones from the same Company.

Name ReasonCode Company Order
R1-F Reason1 Food 1
R1-L Reason1 Liquor 1
R2-F Reason2 Food 2
R2-L Reason2 Liquor 2

Using config migration tool, when I migrate ResonCodeOrders it seems to randomly pick the Reason Code based only on the name. I end up with ReasonCodeOrders pointing to the wrong ReasonCode. I would like Company to also be used when selecting the ReasonCode.

Desired Solution

Ability to make use of multiple columns in source table to identify the correct record in the lookup table. In the above example both Reason Code (name) and Company (name) would be used when selecting records from Reason Code table