Move Finance knowledge to the Microsoft-owned layer, add nine scoped rules with eighteen AL samples, and register bounded Finance review with complete paired evaluation coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2.7 KiB
| bc-version | domain | keywords | technologies | countries | application-area | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
finance |
|
|
|
|
Change a transaction's dimension set reference, not a shared set's membership
Description
The same Dimension Set ID can be referenced by an unposted journal line and by many already-posted entries. Editing or deleting the persisted set's dimension/value rows therefore changes the meaning of unrelated transactions, including posting history. The dimension-set search tree also relies on those combinations remaining stable; a set is not a mutable child collection owned by one journal line.
Best Practice
To change an unposted transaction's dimensions, load its set into a temporary Dimension Set Entry buffer with DimensionManagement.GetDimensionSet, change the buffer, and obtain a reusable ID with GetDimensionSetID. Validate dimension values in the buffer so Dimension Value ID matches the chosen value. Store the resulting ID on the transaction and synchronize its projections through that record's supported dimension validation.
For already-posted G/L dimensions, use the supported dimension-correction workflow rather than changing shared rows. Read-only access, temporary buffers, and standard maintenance of projection metadata such as Global Dimension No. are not membership changes. This rule protects shared posting history; it does not prescribe custom-table/default-dimension wiring.
See sample: do-not-edit-shared-dimension-sets.good.al.
Anti Pattern
Follow a journal/document/ledger Dimension Set ID to a persistent Dimension Set Entry and modify, rename, or delete its dimension/value membership in order to change that one transaction. Inspect IsTemporary guards, aliases, and the fields written before reporting: the same operations on a temporary working copy are expected.
See sample: do-not-edit-shared-dimension-sets.bad.al.