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

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.