0

Dynamics AX 2012 R3 – Keeping track of errors

While debugging or any other development process you come across errors. Sometimes you click away the errors to fast or your client can crash. For these scenarios I created a error log. I only use this in my dev environment.

Add the following piece of code in the “Info” class, “Add” function.

Below is a table declaration.

//TODO NOT TO PRODUCTION!
//START DECL
DEVErrorLog errorLog;
//END DECL

At the end of the function you insert this piece of code just before the returning value.

//TODO NO TO PRODUCTION!
//START
if (_exception == Exception::Error || _exception == Exception::Warning)
{
ttsBegin;
errorLog.Exception = _exception;
errorLog.ErrorDescription = _txt;
errorLog.insert();
ttsCommit;
}
//END

If this class generates any Error or Warning messages it will insert it in the error log table. Error messages color RED and warnings will be yellow.

Download the two XPO files from https://www.dropbox.com/sh/zlyfbg9bqe4aowo/AACKO9wftOwbWBzfqiOyeL8na?dl=0

jack

Leave a Reply