How to add dimension on forms
Table - we need to create defaultdimension field with Edt as DimensionDefault and create relation with DimensionAttributeValueSet (Recid) to the DefaultDimension field.
Form - we need to add the table to the datasource part. In the Design side we need to create FinancialDimension Tab with Empty Fields.
Code - we need to write the code in following Methods
Class Declaration
public class FormRun extends ObjectRun
{
DimensionDefaultingController dimensionDefaultingController;
}
This object does the work in handling the dimensions. And it does it without that much work from our site.
init
public void init()
{
boolean financialsDimensionsEnabled = true;
super();
dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(false, true, financialsDimensionsEnabled, 0, this, tabFinancialDimensions, "@SYS138491");
dimensionDefaultingController.parmAttributeValueSetDataSource(KbDimensionTab_ds, fieldStr(KbDimensionTab, defaultdimension));
dimensionDefaultingController.parmValidateBlockedForManualEntry(true);
tabFinancialDimensions.enabled(financialsDimensionsEnabled);
}
The first line instantiates the object which takes – among others – the formRun and the empty tab page as parameters.
The second line tells the class what data source and which field on the table it should use when handling the financial dimensions.
The third activates the class. If you have the dimensions on a separate tab page on your form you can call the pageActivated method when that tab page is activated to increase performance.
write
public void write()
{
super();
dimensionDefaultingController.writing();
}
active
public int active()
{
int ret;
ret = super();
dimensionDefaultingController.activated();
return ret;
}
delete
public void delete()
{
super();
dimensionDefaultingController.deleted();
}
pageactivated
public void pageActivated()
{
dimensionDefaultingController.pageActivated();
super();
}
DAVS- it stores recid of dimension
DAVSI - recid of value .
how to add dimensions on tables
1) Create New table and EDT of Dimension Default to your table.
2) Set the relation of DimensionAttributValueSet table (Recid field) to your table of DimensionDefault.
once create the table as shown above. we need to create View for your table
3) Create View for your table named as DimensionAttributeKbDimension
4) Change the Datasource name as BackingEntity
5) drag the Itemname,Tracking no and Recid to the Field and changed name as Name,Value and Key for the 3 fields.
5) Create and run the following job to clear the dimension cache:
static void clearCache(Args _args)
{
DimensionCache::clearAllScopes();
info("done");
}
6)GL--Setup--FinancialDimension.Click new and select your table name from the use values from field.
7) enter the dimension name for your table.e.g KbDimension
8) click the financial dimension button for your KbDimension.
9) see the financial dimension form for your table.here we can see yourtable data of itemname and trackingno field.
10) Goto GL--Setup---Chart of Accounts--configure account structures.
11) select anyone of structure. i have selected Account structure P&L and click the edit button.
select the ADD Segement.
12) once selected the value and click ADD Segement button. automatically coloumn will added to the form as shown below
13) finally, click the activate button.
https://sumitsaxfactor.wordpress.com/2011/12/16/getting-individual-dimension-combination-valuesdimension-storage-class-ax-2012/