25 October 2016

how to get Dimension Value using Default dimension in AX 2012

Option 1:

DimensionAttributeValueSetStorage    dimStorage;
str dimval;

dimval = DimensionAttributeValueSetStorage::find(salesQuotationTable.DefaultDimension).getDisplayValueByIndex(2);
info(strFmt("%1",dimval));

Option 2:

public void financialDimValue(Name _attributeName)
{
    DimensionAttributeValueSet          ceDimensionAttributeValueSet;
    DimensionAttributeValueSetItem      ceDimensionAttributeValueSetItem;
    DimensionAttributeValue             ceDimensionAttributeValue;
    DimensionAttribute                  ceDimensionAttribute;
    ;

    select RecId from ceDimensionAttributeValueSet
        where  ceDimensionAttributeValueSet.RecId == salesQuotationTable.DefaultDimension
    join RecId, DisplayValue from ceDimensionAttributeValueSetItem
        where ceDimensionAttributeValueSetItem.DimensionAttributeValueSet == ceDimensionAttributeValueSet.RecId
    join RecId from ceDimensionAttributeValue
        where ceDimensionAttributeValue.RecId == ceDimensionAttributeValueSetItem.DimensionAttributeValue
    join RecId, Name from ceDimensionAttribute
        where ceDimensionAttribute.RecId == ceDimensionAttributeValue.DimensionAttribute
        && ceDimensionAttribute.Name == _attributeName;

    inventSite          =   InventSite::find(ceDimensionAttributeValueSetItem.DisplayValue);
}

1 comment:

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...