static void StoringErrors(Args _args)
{
LedgerJournalTable ledgerJournalTable;
int i;
CustomErrorLog customErrorLog;//Created a new custom table to store error log
;
try
{
//Any Business Logic can be written, i took ledgerjournaltable
while select ledgerJournalTable
{
//Business logic
}
}
catch(exception::Error)
{
customErrorLog.ErrorType = ErrorType::Error;
customErrorLog.Message = infolog.text(i);
customErrorLog.insert();
}
}
H@ppy D@xing...!
try and catch example and Catching the Error into the errorLog Table (AX 2012 and AX 7)
Hi Folks,
Here is the example of both try and catch scenerio and catching/storing the error into the table in the below peace of code.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment