Monday, March 11, 2013

Ax 2012 Hide Financial dimensions.

Requirement: If we need to not show one or more financial dimensions in any required form.
We need to hide a financial dimension in customer master.
Soln:
Create a new table to hold the dimension attribute and primary table name of the form in which we want to hide the dimension.















Insert records into the table.
 


\









Modify the DimensionDefaultingControllerBase and DimensionDefaultingController class Class\DimensionDefaultingControllerBase ClassDeclaration()












setupEditAreaControls()
HKS_DimAttributeHide HKS_DimAttributeHide; //Add new variable
Add the below code.

loadAttributeSet()
HKS_DimAttributeHide HKS_DimAttributeHide; //Add new variable
Add the below code.

Class\DimensionDefaultingController
parmAttributeValueSetDataSource()
Set the enumstableName to the calling table datasource (In the above example, this will be custTable). enumstableName = _dataSource.table(); //hks

Open the custTable form and check the financial dimensions. VendorGroup and ItemGroup will not be displayed.
Open any other form (ex: vendTable) and check the financial dimensions. All dimensions should be visible.