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);
totalAmount = purchTotals.purchTotalAmount();

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


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;

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