Sunday, July 3, 2016

Ledger Dimension Value by account structure name using AxDimensionUtil

//Ledger Dimension Value by account structure name and AxDimensionUtil
static void GetLedgerDimensionandAccstructure(Args _args)
{
    RecId fromLedgerdimension = 5637145334;
    RecId toLedgerdimension;
    toLedgerdimension = DimensionDefaultingService::serviceCreateLedgerDimension(fromLedgerdimension);
    info(strFmt("From RecId %1 to %2", fromLedgerdimension, toLedgerdimension));   
    info(strFmt("From Display value %1 to %2",
                conPeek(AxdDimensionUtil::getLedgerAccountValue(fromLedgerdimension), 1),
                conPeek(AxdDimensionUtil::getLedgerAccountValue(toLedgerdimension), 1)));
    info(strFmt("From Account structure %1 to %2",
        DimensionStorage::getAccountStructureFromLedgerDimension(fromLedgerdimension).Name,
        DimensionStorage::getAccountStructureFromLedgerDimension(toLedgerdimension).Name));    
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...