Hi yzhums. Thanks for suggesting using Item Attribute Value Mapping. I'm aware of this table and should have been clearer in my original post that my intention is to build a historical version of it.
Therefore if Item Attribute Value Mapping holds Item <> Attribute ID <> Attribute Value ID mappings, my new table will have Date <> Item <> Attribute ID <> Attribute Value ID mappings. This way, reports can look back at what attribute mapping existed on some historical date.
And to rephrase my original concern; if Business Central prunes the Attribute / Attribute Value tables for those IDs that are no longer mapped to any item after an update, it would be a problem for my history table that still references the deleted Attribute / Attribute Value IDs.
The situation explained more graphically:
Starting context
Item Attribute (table 7500):
Item Attribute Value (table 7501):
Item Attribute Value Mapping (table 7505):
| Item No. |
Attribute ID |
Attribute Value ID |
| 1 |
1 |
1 |
| 2 |
1 |
2 |
My new table, "Item Attribute Value Mapping History":
| Date |
Item No. |
Attribute ID |
Attribute Value ID |
| January 2023 |
1 |
1 |
1 |
| January 2023 |
2 |
1 |
2 |
Change event
A Business Central user modifies the attribute value for item #2 in March 2023, such that the mapping tables become (changes in yellow):
Item Attribute Value Mapping (table 7505):
| Item No. |
Attribute ID |
Attribute Value ID |
| 1 |
1 |
1 |
| 2 |
1 |
1 |
My new table, "Item Attribute Value Mapping History":
| Date |
Item No. |
Attribute ID |
Attribute Value ID |
| January 2023 |
1 |
1 |
1 |
| January 2023 |
2 |
1 |
2 |
| March 2023 |
2 |
1 |
1 |
My question
At this point, does Business Central delete the record with ID = 2 in Item Attribute Value (table 7501), since it is no longer used in any mapping (table 7505)? It would make sense from a BC perspective, though it doesn't know my history table still uses that ID. If it does delete it, then I need my history table to store actual name values ("Red") instead of IDs.
I will experiment to verify this myself, but figure it could be the case that I don't see the deletion right away, if it only happens during some monthly maintenance task.