Purchase Order Amount

To Get the particular PO amount:


static void _GetPurchTotalAmount(Args _args)
{
PurchTotals purchTotals;
PurchTable purchTable = PurchTable::find('000023');
AmountCur totalAmount;
;

purchTotals = PurchTotals::newPurchTable(purchTable);
purchTotals.calc();
totalAmount = purchTotals.purchTotalAmount();

setPrefix('Purchase Order');
info(strFmt('%1 - Total Value: %2', purchTable.PurchId, totalAmount));
}

Advertisements

Dialog before Ax application quite

A dialog box will prompt to accept the condition from user to really quit the application or not:
Override the following method:
@ Classes\Info\canShutdown


public boolean canShutdown(boolean _silent)
{
    boolean ret;
;
    DocuFileWatchDog::openFiles(_silent);

    if(Box::yesNo("Are you sure ? You will quit Dynamics AX!",DialogButton::No, "Quit Application ?") == DialogButton::Yes)
    {
        ret = super(_silent);
        return ret;
    }
    else
    {
        return false;
       
    }
}