How to add financial dimensions on form in ax 2012

How to add financial dimensions on form in ax 2012

  • ·        Add TabPage called FinancialDimensionsTabPage  which should have the property AutoDeclaration set to Yes


  • ·        In classdeclaration declared the DimensionDefaultingController:


class FormRun extends ObjectRun
{
    DimensionDefaultingController     dimensionDefaultingController;
}



  • ·        In the form’s override Init method:

public void init()
{
          super();
          dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(true, true, true, 0, this, FinancialDimensionsTabPage, "@SYS138487");
 dimensionDefaultingController.parmAttributeValueSetDataSource(TableName_ds, fieldStr(TableName, DefaultDimension));

 dimensionDefaultingController.pageActivated();
}


  • ·        In the datasource override active() method:


public int active()
{
 int ret;
 ret = super();
 dimensionDefaultingController.activated();
 return ret;
}
  • ·        In the datasource override write method:


public void write()
{
 dimensionDefaultingController.writing();
 super();
}

  • ·        In the datasource override delete method:


public void delete()
{
 super();
 dimensionDefaultingController.deleted();
 this.refresh();
}

  • ·        In the design tabPage override pageActivated method:


public void pageActivated()
 {
 dimensionDefaultingController.pageActivated();
 super();
 }

Comments

Popular posts from this blog

How to loop through enum in dynamics ax 2012 using x++

How to read from csv file in Dynamics AX 2012 Through X++

How to Create Transfer Journal in Dynamics AX 2012 Through X++