✏️ Explanatory Question

What are financial dimensions in Dynamics 365 Finance & Operations? Explain the difference between a default dimension and a ledger dimension, the key tables involved (DimensionAttributeValueSet, DimensionAttributeValueCombination), and how you work with them in X++.

👁 5 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

D365 F&O • X++ INTERVIEW

Financial Dimensions & the Ledger Dimension Framework in Dynamics 365 Finance & Operations

Question 53 — How default dimensions, ledger dimensions and account combinations work under the hood.

Interview Question

What are financial dimensions in Dynamics 365 Finance & Operations? Explain the difference between a default dimension and a ledger dimension, the key tables involved (DimensionAttributeValueSet, DimensionAttributeValueCombination), and how you work with them in X++.

Model Answer (Short)

Financial dimensions add reporting and analytical segments (like Department, Cost Center, Business Unit) to transactions. There are two key concepts. A default dimension is a set of dimension values without a main account — stored via DimensionAttributeValueSet and referenced on master data (customers, items, etc.). A ledger dimension is a full account + dimension combination used on ledger postings — stored via DimensionAttributeValueCombination. Both ultimately reference DimensionAttributeValue (a used dimension value) and DimensionAttribute (the dimension definition). In X++ you rarely manipulate these tables directly; instead you use framework helpers like DimensionAttributeValueSetStorage and DimensionStorage / LedgerDimensionFacade / AxdDimensionUtil to read and build dimension values safely.

Default Dimension vs. Ledger Dimension

The two concepts

  • Default dimension — dimension values without a main account; used on master/reference data and defaulted onto transactions.
  • Ledger dimension — a main account + dimensions combination used on actual ledger postings.
  • Default dimensions are stored via DimensionAttributeValueSet.
  • Ledger dimensions are stored via DimensionAttributeValueCombination.

Key Framework Tables

Table Purpose
DimensionAttributeDefines a dimension (e.g. Department)
DimensionAttributeValueA used value of a dimension (e.g. Dept 100)
DimensionAttributeValueSetA set of values = a default dimension
DimensionAttributeValueSetItemIndividual values within the set
DimensionAttributeValueCombinationAccount + dimensions = a ledger dimension
MainAccountThe main account segment
KEY DISTINCTION
No account = Default dimension (ValueSet)  •  Account + dims = Ledger dimension (Combination)

Prerequisites (Rule 5)

  • Visual Studio with the Dynamics 365 developer tools.
  • A custom model / package for your objects.
  • Configured financial dimensions and an account structure in the client.
  • Familiarity with the Dimension* framework classes.

Code Example — Reading a default dimension value

// Get the 'Department' value from a default dimension (DimensionAttributeValueSet)
public Name getDepartment(DimensionDefault _defaultDimension)
{
    DimensionAttributeValueSetStorage storage =
        DimensionAttributeValueSetStorage::find(_defaultDimension);

    DimensionAttribute dimAttr =
        DimensionAttribute::findByName('Department');

    return storage.getDisplayValueByDimensionAttribute(dimAttr.RecId);
}

Building a default dimension from values

public DimensionDefault buildDefaultDimension()
{
    DimensionAttributeValueSetStorage storage = new DimensionAttributeValueSetStorage();

    DimensionAttribute deptAttr = DimensionAttribute::findByName('Department');

    DimensionAttributeValue davDept =
        DimensionAttributeValue::findByDimensionAttributeAndValue(
            deptAttr, '100', false, true);

    storage.addItem(davDept);

    return storage.save();   // returns the DimensionDefault RecId
}

Getting the main account from a ledger dimension

// Extract the main account from a ledger dimension (combination)
public MainAccountNum getMainAccount(LedgerDimensionAccount _ledgerDimension)
{
    MainAccount mainAccount =
        MainAccount::findByLedgerDimension(_ledgerDimension);

    return mainAccount.MainAccountId;
}

Default Dimension vs. Ledger Dimension

Aspect Default Dimension Ledger Dimension
Contains main account No Yes
Storage table DimensionAttributeValueSet DimensionAttributeValueCombination
Used on Master/reference data Ledger postings
Helper class DimensionAttributeValueSetStorage DimensionStorage / LedgerDimensionFacade

Points the interviewer wants to hear

  • Financial dimensions add reporting segments to transactions.
  • Default dimension = values without an account (ValueSet).
  • Ledger dimension = account + dimensions (ValueCombination).
  • Use framework helpers like DimensionAttributeValueSetStorage — don't manipulate tables directly.
  • Both build on DimensionAttribute and DimensionAttributeValue.

Likely Follow-up Questions

  • What is the difference between a default dimension and a ledger dimension?
  • Which table stores a ledger dimension (account + dimensions)?
  • Why use DimensionAttributeValueSetStorage instead of direct SQL?
  • How do you extract the main account from a ledger dimension?

Key Takeaway

Financial dimensions come in two flavours: default dimensions (values without an account, in DimensionAttributeValueSet) and ledger dimensions (account + dimensions, in DimensionAttributeValueCombination). Always work through the Dimension framework helper classes rather than the raw tables.