Tuesday, 24 December 2013

Get Opening Balance in ax 2009 through X++

real  getOpeningBalance(LedgerAccount  _accountNum)
{

    DimensionCriteria   dimensionCriteriaEmpty;
    Transdate           periodEnd;
    transdate periodStart = LedgerPeriod::findOpeningDate(fromDate);
    LedgerBalanceSum_CurrentMST   ledgerBalance;
    ;
    periodEnd = fromDate - 1;

    ledgerBalance= new LedgerBalanceSum_CurrentMST(periodStart,
                                                   periodEnd,
                                                   dimensionCriteriaEmpty,
                                                   NoYes::Yes,
                                                   Noyes::Yes,
                                                   NoYes::Yes,
                                                   OperationsTax::Current,
                                                   DebCredProposal::None,
                                                   NoYes::Yes,
                                                   NoYes::Yes);
    return ledgerBalance.balance(_accountNum);


}

No comments:

Post a Comment