Alfasith AX

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

Thursday, June 19, 2014

Calculate PurchTotal class and its related information in X++

Hi,

static void PurchTotalAlfasith(Args _args)
{
    PurchTotals   purchTotals;
    PurchTable   purchTable;
    container   displayFields;
    PurchtotalsForm         totalsForm;
    purchTable = PurchTable::find('000396');          
    totalsForm   = PurchtotalsForm::newPurchTotalsForm(purchTable, 1);
    totalsForm.calctotals();
    print " Total quantity = %1", totalsForm.qtyValue();
    print " Total Discount = %1",totalsForm.endDiscValue();
    print " Total Chanrges = %1",totalsForm.sumMarkUpValue(); // this includes all the freight charges..
    print " Total Invoiced = %1",totalsForm.invoiceAmountValue();
    print " Sub total      = &1",totalsForm.sumLinesValue();
    pause;
}

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...