Capgemini / Capgemini/xrm-datamigration-xrmtoolbox

Handle composite keys when choosing lookup data

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

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Start by tracing the config migration tool's lookup resolution for ReasonCodeOrders, using the ReasonCode and Company fields in the example as a reproduction case. Confirm how source columns are selected for lookup matching; done means records with the same ReasonCode name resolve to the entry with the matching Company rather than an arbitrary entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.