Hello,
I want to know if is possible to get the mesage given in infolog in a log message ?
For example, when we have error in a action, AX give us error in an infolog, I want to know if I can keep this message in an infolog ?
Thanks by advance.
*This post is locked for comments
Hi Hatice,
You can get the content of the infolog as a container like this:
infologData = infolog.infologData();
You can then store this container, or loop the contents of it.
Doing this will clear the infolog, so you might want to display it again like this:
infolog.view(infologData );
To check if there are errors in the infolog, do something like this:
private boolean hasError(Container infoLogData)
{
boolean hasError = false;
SysInfologEnumerator sysInfologEnumerator;
;
// analyse the infolog to see if there are any errors
sysInfologEnumerator = SysInfologEnumerator::newData(infoLogData);
// loop the enumerator and
// jump from loop when an error has been found
while (sysInfologEnumerator.moveNext() && !hasError)
{
switch (sysInfologEnumerator.currentException())
{
case Exception::Error:
hasError = true;
break;
}
}
return hasError;
}
Is that what you are looking for?
Best Regards,
Klaas Deforche
I Daniel
As I understand you want to store every infolog which is generated in system.
You have to overwrite the infolog.add() method. There you get the infolog information by arguments. Now you can insert a record in your own created infologstore table.
Do you know what I mean?
Hello Daniel,
Thanks for your response but this solution doest not ok :(
Do you know what can I do ?
Have a look at SysTestResult.endTest(). It uses a listener to store the InfoLog.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156