This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
This post is part of the series »Dynamics AX 2012 - Financial dimensions«
In Dynamics AX 2012, the handling of financial dimensions has changed. Both on the surface and the underlying data model.
In earlier versions you find one field - usually named dimension - of type array. Now you'll find a field derived from RecId called DefaultDimension (or similar).
In this series I want to specifically address these changes and present one or the other piece of code.
|
|
|
|
|
|
The following job demonstrates how to display the values of a financial dimension - in the example Department - via X++.
static void getValues4Dimension(Args _args) { DimensionValueService dimensionValueService; DimensionContract dimensionContract; List dimensionValueContractList; ListEnumerator listEnumerator ; DimensionValueContract dimensionValueContract; DimensionValue dimensionValue; dimensionValueService = new DimensionValueService(); dimensionContract = new DimensionContract(); dimensionContract.parmDimensionName('Department'); dimensionValueContractList = dimensionValueService.getDimensionValues(dimensionContract); listEnumerator = dimensionValueContractList.getEnumerator(); setPrefix(strFmt("Dimension %1: ", dimensionContract.parmDimensionName())); while(listEnumerator.moveNext()) { dimensionValueContract = listEnumerator.current(); dimensionValue = dimensionValueContract.parmValue(); info(dimensionValue); } }