Monday, 12 March 2018

Default dimension in Ax 2012

Creating default dimension in ax 2012

Description 

Financial dimensions are data classifiers that are used for financial reporting. Financial dimensions identify information such as the purpose, cost center, and department. Financial dimensions have changed considerably since Microsoft Dynamics AX 2012

Screen shoot and code are below


1. Create a table and fields 

2. Add int 64 data type fields - > Add EDT ' DimensionDefault'


3. Create a normal relations
4. RRFinancialDimensionTable.DimensionDefault == DimensionAttributeValueSet.RecId


5. Create a custom form 
6. Add datasource in the form 
7. Add design Tab - Tab page : General and add another TabPage : Financial dimension
8. Set Auto declaration for Financial dimension tab properties  : Yes 
9. Need permission : Manual for Financial dimension
10. Set HidIfEmpty :: No
11. Add data source and Caption
12. Drag and drop fields in the general tab
13. form run code below

DimensionDefaultingController dimDefaultingController;

14. Write form method  below code 

public void init()
{
    super();

    dimDefaultingController=DimensionDefaultingController::constructInTabWithValues(
        true, 
        true, 
        true, 
        0, 
        this, 
        Financialdimension, // Tabpage name 
        "@SYS138487"        // display label
        );

    dimDefaultingController.parmAttributeValueSetDataSource(
        RRFinancialDimensionTable_ds,       // Datasource
        fieldstr(RRFinancialDimensionTable, // Table
        DimensionDefault                    // fields 
        ));
}

15. Write below code in the datasource method

// Active override method
public int active()
{
    int ret;
    ret = super();
    dimDefaultingController.activated();
    return ret;
}


// write override method
public void write()
{
    dimDefaultingController.writing();
    super();
}


// delete override method

public void delete()
{
    super();
    dimDefaultingController.deleted();
}

16. Write Tabpage method below code

// page Activated override method
public void pageActivated()
{
    dimDefaultingController.pageActivated();
    super();
}




No comments:

Post a Comment

Step-by-Step Guide to Restore a SQL BACPAC File - Microsoft dynamics D365 Fin & Ops

 Restore steps for bacpac file in to SQL server - Microsoft dynamics D365 Fin & Ops. Log in to LCS and navigate to the asset library. On...