Tuesday, 3 March 2015

Display financial dimension in a list page in AX 2012

Inorder to display financial dimension field on a list page just add a string edit form control in the grid in PurchTableListPage and mention the datasource as PurchTable and datamethod as showFinancialDimension.

showFinancialDimension is a display method written in the PurchTable methods with the following code :

display str showFinancialDimension()
{
    PurchTable  purchTable;
    DimensionAttributeValueSetStorage   dimStorage;
    counter i;
    str dimension;

    dimStorage = DimensionAttributeValueSetStorage::find(purchTable.DefaultDimension);

    for (i = 1 ; i <= dimStorage.elements() ; i++)
    {
        if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "BusinessUnit")
        {
            dimension = dimStorage.getDisplayValueByIndex(i);
        }
    }
    return dimension;
}

2 comments:

  1. I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. FXGM ZA review

    ReplyDelete