From fa3d04c56c0ce6b577298b9c7817f2641eea815c Mon Sep 17 00:00:00 2001 From: Michael Dieringer <65093775+MichaelDieringer@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:55:45 +0200 Subject: [PATCH] Fix dimension-management-wiring.md: ValidateShortcutDimCode and CreateDim do not exist on the current DimensionManagement codeunit Verified against microsoft/BCApps: the real master-table validation procedure is ValidateDimValueCode (or ValidateShortcutDimValues when a DimSetID is also needed), and the real document-side inheritance procedure is GetDefaultDimID, not CreateDim. Caught from Jesper Schulz-Wedde's review thread, which had been partially hidden by GitHub's comment folding. Co-Authored-By: Claude Sonnet 5 --- .../data-modeling/dimension-management-wiring.good.al | 2 +- .../knowledge/data-modeling/dimension-management-wiring.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/microsoft/knowledge/data-modeling/dimension-management-wiring.good.al b/microsoft/knowledge/data-modeling/dimension-management-wiring.good.al index 2af97b8..1352b67 100644 --- a/microsoft/knowledge/data-modeling/dimension-management-wiring.good.al +++ b/microsoft/knowledge/data-modeling/dimension-management-wiring.good.al @@ -13,7 +13,7 @@ table 50100 "Course" var DimMgt: Codeunit DimensionManagement; begin - DimMgt.ValidateShortcutDimCode(1, "Global Dimension 1 Code"); + DimMgt.ValidateDimValueCode(1, "Global Dimension 1 Code"); DimMgt.SaveDefaultDim(Database::Course, "No.", FieldNo("Global Dimension 1 Code"), "Global Dimension 1 Code"); end; } diff --git a/microsoft/knowledge/data-modeling/dimension-management-wiring.md b/microsoft/knowledge/data-modeling/dimension-management-wiring.md index c939952..8e932ab 100644 --- a/microsoft/knowledge/data-modeling/dimension-management-wiring.md +++ b/microsoft/knowledge/data-modeling/dimension-management-wiring.md @@ -1,7 +1,7 @@ --- bc-version: [all] domain: data-modeling -keywords: [dimensions, dimensionmanagement, global-dimension, shortcut-dimension, default-dimension, validateshortcutdimcode, createdim] +keywords: [dimensions, dimensionmanagement, global-dimension, shortcut-dimension, default-dimension, validatedimvaluecode, getdefaultdimid] technologies: [al] countries: [w1] application-area: [all] @@ -17,7 +17,7 @@ Adding dimension support to a custom master or document table is not just a matt ## Best Practice -A master table should validate its dimension fields through `ValidateShortcutDimCode` and `SaveDefaultDim`, and create/delete the matching Default Dimension records in `OnInsert`/`OnDelete`. A document table should add Shortcut Dimension fields validated the same way, and call `CreateDim` to pull dimension values from the related master record whenever the field that attaches the document to that master changes. +A master table should validate its dimension fields through `ValidateDimValueCode` (or `ValidateShortcutDimValues` when a `DimSetID` is also needed) and `SaveDefaultDim`, and create/delete the matching Default Dimension records in `OnInsert`/`OnDelete`. A document table should add Shortcut Dimension fields validated the same way, and call `GetDefaultDimID` to pull inherited dimension values from the related master record whenever the field that attaches the document to that master changes. See sample: `dimension-management-wiring.good.al`.