Generate Ledger Dimension

LedgerDimension represents an int64 code (which is not readable for humans), which comprises a code containing the (financial) dimensions for a journal, which is readable in for example the journal voucher’s “account” column. The ledger dimension is the RecId from the table DimensionAttributeValueCombination, and in the DisplayValue field of this table, we can see the readable format for the user.

The account column, used in the Journal voucher is an example of a field derived from the ledger dimension.

The following job is an example how we can generate a ledger dimension code in X++ with the dimensions of our choose, we can use as a ledger dimension for posting journal account/ offset account value.

This job takes the mainAccountId and a container as parameter. In the container we can add up to 3 additional dimensions, but depending of our choice we can add more or less. In this example “Unit”, “Department” and “Region” are the additional dimensions as shown in the screenshot below.

The logic below, actually returns a Recid from the table DimensionAttributeValueCombination (LedgerDimension) based on the given parameters.