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

Customer inbound custom service in D365 F&O with X++

  [DataContractAttribute] class GOD_CustomerCreateContract {     str                 accountNum;     // Optional; if blank, a number sequenc...