RSS

Monthly Archives: August 2016

Replace financial dimension value in the Budget Ledger dimension(Budget Planning)

In my recent post, Replace financial dimension value in the ledger dimension. we saw how can we replace the financial dimension in the ledger dimension.

In AX 2012 R3,  Budget planning functionality brought budget ledger dimension which is the extension of the ledger dimension.

Today, we will see how can we replace financial dimension in the budget ledger dimension.

AxdDimensionUtil having methods for the budget planning ledger dimension here is the link for that. Budget Planning helper methods in the AxdDimensionUtil

Below is the method can be used to replace dimension value in the budget planning ledger dimension. Just pass the ledger dimension(RecId), DimensionName (which you want to replace ) and new dimension value.

public static LedgerDimensionBudgetPlanning replaceDimValueBudgetPlanning(
LedgerDimensionBudgetPlanning   _ledgerDimension,
Name                            _dimAttrName,
DimensionValue                  _dimValue)
{
LedgerDimensionBudgetPlanning   ledgerDimension;
container                       conLedgerDimension;

conLedgerDimension = AxdDimensionUtil::getBudgetPlanningAccountValue(_ledgerDimension);

if (conFind(conLedgerDimension, _dimAttrName))
{
conLedgerDimension = conpoke(conLedgerDimension, conFind(conLedgerDimension, _dimAttrName)+1, _dimValue);
}
else
{
conLedgerDimension = conpoke(conLedgerDimension, 3, conPeek(conLedgerDimension, 3) +1);
conLedgerDimension = conIns(conLedgerDimension, conlen(conLedgerDimension) +1, _dimAttrName);
conLedgerDimension = conIns(conLedgerDimension, conlen(conLedgerDimension) +1, _dimValue);
}

ledgerDimension = AxdDimensionUtil::getBudgetPlanningAccountId(conLedgerDimension);

return ledgerDimension;
}

 

 

Tags: , , , , , , , ,

Get value from budget planning ledger dimension.

AxdDimensionUtil class is providing helpful methods for handling the budget planning ledger dimension.

To get the ledger dimension from the value (offset string)
AxdDimensionUtil::getBudgetPlanningAccountId(offsetAccountString);
To get more details see To get the ledger dimension from the value
To get the value (offset string from the ledger dimension)
conLedgerDimension = AxdDimensionUtil::getBudgetPlanningAccountValue(
                                                   _ledgerDimension);
This method return the container

//3110101-104190-1305—00000005,Account structure – MRKT,4,
//MainAccount,3110101,Org_CC,104190,Opr_CC,1305,Department,00000063

It gives you the display value, account structure,  number of dimension including main account.

 

Tags: , , , , , ,