31 January 2013

Exception handling in AX / Try catch throw in AX

public boolean createExcelApp()
{
boolean ret = true;
;
try
{
sysExcelApplication = SysExcelApplication::construct();
if (sysExcelApplication == null)
{
ret = false;
throw Exception::Error;
}
}
catch (Exception::Error)
{
error("@SYS59928");
}
return ret;
}

=============UPdate exception=========

System.Exception ex;
        try
        {
            tableBuffer.field = value;
            tableBuffer.update();
        }
        catch(ex)
        {
            System.String messageEx = ex.Message;
            errorMessage = messageEx;
        }

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...