Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, November 19, 2014

Code to print Ledger journal balance in AX

static void AlfasithPrintLedgerBalance(Args _args)

{

    LedgerBalanceMainAccountAmounts balance;

    MainAccountListPageBalanceParameters balanceParameters;

    MainAccount mainAccount;

    ;

    mainAccount = MainAccount::findByMainAccountId( "11120005");

    balanceParameters = MainAccountListPageBalanceParameters::construct();

    balance = LedgerBalanceMainAccountAmounts::construct();



    balance.parmAccountingDateRange(balanceParameters.getStartDate(),balanceParameters.getEndDate());

    balance.parmPostingLayer(balanceParameters.getPostingLayer());

    balance.parmIncludeOpeningPeriod(balanceParameters.getIncludeOpeningPeriods());

    balance.parmIncludeRegularPeriod(balanceParameters.getIncludeOperatingPeriods());

    balance.parmIncludeClosingPeriod(balanceParameters.getIncludeClosingPeriods());

    balance.parmIncludeClosingPeriodBySystem(balanceParameters.getIncludeClosingPeriods());


    balance.calculateBalance(mainAccount);


    info(strFmt("%1", balance.getAccountingCurrencyBalance()));

}

No comments:

Post a Comment

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...