web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How can I get Error in Infolog when run Batch Jobs daily ?!

(0) ShareShare
ReportReport
Posted on by 110

38562.Untitled.png

My batch jobs status is Ended but when I check log of this batch job, I found an Error. So now I want to create a project or a code snippet to get these Errors to not have to check every batch job everyday. Any suggestion ?!

*This post is locked for comments

I have the same question (0)
  • Mateusz G Profile Picture
    50 on at

    You can retrieve data from BatchJobHistory table and use BatchJobHistory::showLog(batchJobHistory.RecId); that returns container of logs.

  • Nguyen Do Huy Profile Picture
    110 on at

    Thanks Mateusz.

    I just need Error logs. Any suggestion ?

  • Mateusz G Profile Picture
    50 on at

    In this container you have type of log. Example:

    6355.Capture2.PNG

    As you can see, 3 in each first element of container, means that is Error.

    6355.Capture2.PNG

  • Nguyen Do Huy Profile Picture
    110 on at

     64104.Untitled.png

    Hello Mateusz, when I tried to info the info log, it happened this error. Do you know how to info a Container in a container ?!

  • Mateusz G Profile Picture
    50 on at

    look at \Forms\BatchJobHistory\showLog()

    probably it is infolog.import()

  • Nguyen Do Huy Profile Picture
    110 on at

    Thanks Mateusz. It is very helpful. But there is 1 more thing I want to ask.  Like you said before, if the first element of container is 3, there is an error. So my question is what is that "3" stands for how can I get that in my code ?

  • Mateusz G Profile Picture
    50 on at
                infolog.import(conpeek(data, i+2));
                
                logs = conpeek(data, i+2);
                for(j = 2; j <= conLen(logs); j++)
                {
                    logData = conPeek(logs, j);
                    
                    if(conPeek(logData, 1) == 3)
                    {
                        info(strFmt("Error : ", conPeek(logData, 2)));   
                    }
                }

    it is small piece of code to show info only with error messages.

  • Nguyen Do Huy Profile Picture
    110 on at

    6787.Untitled.png

    Hello Mateusz,

    It's blank. Do you have any ideas ?

  • Mateusz G Profile Picture
    50 on at

    I don't know how your log container looks like and how it's nested. I showed you code that is fitted to container i presented before. generally you might to use conPeek properly. Did I help?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans