Monday, 30 March 2015

Display method to return enum value from select query in Axapta

display AssetDepreciation depreciationValue()
{
    AmountMSTSecondary dep;
    ;

    while select assetTrans
    where assetTrans.AssetId    == assetId
       && assetTrans.BookId     == bookId
       && assetTrans.TransType  == AssetTransType::Depreciation
    join ledgerTrans
    where ledgerTrans.Voucher   == assetTrans.Voucher
       && ledgerTrans.TransDate == assetTrans.TransDate
       && ledgerTrans.AmountMSTSecond < 0
    {
        dep += ledgerTrans.AmountMSTSecond;
    }

    return dep;
}

No comments:

Post a Comment