Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Batch Job executes but does not show expected results

(0) ShareShare
ReportReport
Posted on by 115

Hi all, 

       I am working with a batch job. When I run the batch job by creating a job and making object of the class, the outcome is as expected. 

When I run the Main method of the batch class and run it, The batch job executes, but does not give me expected results. 

How can I check what is wrong with it? Please help...

  • Martin Dráb Profile Picture
    231,801 Most Valuable Professional on at
    RE: Batch Job executes but does not show expected results

    I'm sorry, but just keep asking me what's wrong doesn't make a good sense. You've never showed us your code, nor you at least told us what it's supposed to do, so it impoossible for me to identify the bug.
    My recommendation is still the same - use the debugger to find out where you code fails. Why haven't you done it yet?

  • 00030000036294D5 Profile Picture
    115 on at
    RE: Batch Job executes but does not show expected results

    Martin.

              I have noticed a new thing. I had recently made few code changes in the batch job class. When I remove my changes, the batch job executes perfectly alright.

    But this is again a bit confusing in a way that when I run the batch job class by creating a job and making an object of the class, the class runs perfectly alright and gives desired results.

    However, when I try to run it through batch job i.e. by running it through the Main method of the batch job class, The batch job gets stuck in executing state and never ends.

    What is wrong here and how do I correct it. Why the class is running through Job and why it is not running through batch job ? Where is the problem ?

  • Martin Dráb Profile Picture
    231,801 Most Valuable Professional on at
    RE: Batch Job executes but does not show expected results

    I'm sorry, but I can't tell you where it got stuck, because I have absolutely no information about your and I can't debug it. The debugger is your hands.

  • 00030000036294D5 Profile Picture
    115 on at
    RE: Batch Job executes but does not show expected results

    Martin,

               I have just compiled my entire class, then generated incremental CIL and afterwards run batch job through Main method of the class.

    The batch job entered into queue. Now, it is showing status as Executing for the last 10 minutes. The same happened yesterday after I generated full incremental CIL and then ran the batch job. Where it gets stuck ?

  • 00030000036294D5 Profile Picture
    115 on at
    RE: Batch Job executes but does not show expected results

    Thanks Martin,

    I have already run both of these one after the other but no use ?

  • Martin Dráb Profile Picture
    231,801 Most Valuable Professional on at
    RE: Batch Job executes but does not show expected results

    You can use the debugger to find out what's going on in your code. Refer to Debugging in Microsoft Dynamics AX 2012 for more information.

    Also, don't forget that batch processes work (by default) in CIL, therefore you should generate CIL after compiling X++.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,933 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,801 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans