Product: Dynamics 365 Business Central
Error: Internal_InvalidTableRelation The field Unit of Measure Code of table Sales Line contains a value (xxx) that cannot be found in the related table (Item Unit of Measure)
Issue: When attempting to export a Purchase Order (850), you receive the error message stating: "Internal_InvalidTableRelation The field Unit of Measure Code of table Sales Line contains a value (xxx) that cannot be found in the related table (Item Unit of Measure)"
Reason: The Unit of Measure passed into Dynamics 365 Business Central from Transaction Manager was invalid
The issue was that both the unitOfMeasure and unitOfMeasureCode fields were mapped to the UOM lookup table. This causes them to interfere with each other, so only one of those fields needs to be mapped out.
Solution - Update Unit of Measure Conversion
Your Transaction Manager should have a UOM Conversion table located at the Trading Partner level that allows you to convert incoming Unit of Measures from what your Trading Partner sends into what Dynamics 365 Business Central requires.
Navigate: Trading Partners - (Partner) - Translations - Lookups
Find: UOM Conversion
Left Column: Dynamics 365 Business Central Unit of Measure
Right Column: Trading Partner sent Unit of Measure
Solution β Use Correct Unit of Measure Field
If you have access to Mapping Manager and were mapping your own Unit of Measure you may of used the unitOfMeasure field which is no longer a valid field - it is a legacy field that has been replaced with the unitOfMeasureCode field.
You'll want to update your Token Mapping to leverage the unitOfMeasureCode instead.
Navigate: Transactions - Sales Order Lines - Details
Unmap: unitOfMeasure
Map: unitOfMeasureCode
You'll need to remove the unitOfMeasure mapping for unitOfMeasureCode to work
rev 04/29/25