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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Mixed problems with batch jobs

(0) ShareShare
ReportReport
Posted on by 210

Hello everyone,

I'm dealing with two problems on batch jobs:

Batch fails after adding a task inside it

This is happening randomly in test environments and in Live as well. Basically all I do is submitting a batch execution, trace it in "Batch jobs" list and add one more task inside the batch itself, setting a dependency between the two tasks. Sometimes the execution works well, sometimes it ends up in error with the following message:

Microsoft.Dynamics.Ax.Xpp.ErrorException: Errore durante l'elaborazione del processo batch FATT.NETTE PRESS AL 30/09/2019 at Dynamics.AX.Application.BatchRun.runJobStaticCodeFromBuffer(Batch buffer) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 831 at Dynamics.AX.Application.BatchRun.runJobStaticFromBuffer(Batch buffer) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 769 at Microsoft.Dynamics.AX.Batch.Batch.ExecuteOneBatchJobTask(BatchTaskInfoWrapper taskInfo)

I know this has to be analyzed properly by a developer but could you just give me some insights? As I said before, this appears randomly. Hours ago it happened in Live environment so I tried the same batch (same tasks & parameters) in Pre-Live and turned out to work well this time.

Setting tasks parameters results in an execution extra-batch

Again, this is happening randomly in test environments and in Live as well. Once I add another task inside the batch job and I set-up the parameters for that execution, the system creates a single running execution of that task, meaning: 

  • I have two tasks inside the batch job: A and B
  • I set up some parameters on B and click OK
  • The system creates a running job for the B task - It must not do that, it could be dangerous for us
  • I still have my batch with A and B tasks with their chosen parameters - That's what I want the system to execute

I wonder if anyone of you faced similar issues or has some insights about them. Thanks for stopping by.

Gian Paolo

I have the same question (0)
  • Pedro Tornich Profile Picture
    955 on at

    Hi Gian,

    Why do you need to manually add tasks to an existing batch job?

  • Gian Paolo Dell Erba Profile Picture
    210 on at

    Hello Pedro,

    Since the system has to process a big amount of data in subsequent and different ways, tying all the tasks involved with a dependency between them it's a good way to save time and be more efficient... This is also because some procedures' executions require a certain amount of time.

    One example could be having two different custom programs, A and B: A creates invoices in Dynamics and all the related transactions, and B creates an xml and a PDF file for each invoice created by A - so we're trying to setup a batch that runs those two programs in the correct sequence, first A and then B.

    We're doing this because the number of invoices created is BIG and we're not sure about when every execution will end: by doing this we're sure that procedure B starts immediately after A without checking A's execution.

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Gian,

    Can you try to get the error in  English? I'm not able to understand this language.

    Note that there are some batch tasks which will evaluate what to do and create one or more processing tasks to divide the workload. E.g. the workflow message processing batch job is by default splitting tasks per 100 messages.

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at

    Hello,

    I imagine you would like to solve this without development, but what happens if you create the batch with all necessary tasks by code instead of adding further tasks manually?

    You can ask a developer to test that scenario for your.

    I've created batch jobs with several tasks before (by code) and never ran into this kind of error. Maybe D365FO behaves differently when you add the tasks manually.

    Just out of curiosity, do you add the second task to the job before or after it starts running?

  • Gian Paolo Dell Erba Profile Picture
    210 on at

    Hello and thanks for your answers!

    @André here is the error message in english:

    Microsoft.Dynamics.Ax.Xpp.ErrorException: An error occurred while processing batch job Anagrafiche at Dynamics.AX.Application.BatchRun.runJobStaticCodeFromBuffer(Batch buffer) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 832 at Dynamics.AX.Application.BatchRun.runJobStaticFromBuffer(Batch buffer) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 770 at Microsoft.Dynamics.AX.Batch.BatchRunAction.Run() at Microsoft.Dynamics.AX.Batch.Batch.ExecuteOneBatchJobTask(BatchTaskInfoWrapper taskInfo)

    @Pedro Thanks for the insight, I feel like our business scenario wouldn't allow such constraint (I mean, referring to my example above, I don't believe customer has to strictly execute A and B together all the times) but I will evaluate this with my team nevertheless.

     

    Thank you!

    Gian Paolo

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Gian,

    Has your question been answered now or do you still need guidance here?

  • Gian Paolo Dell Erba Profile Picture
    210 on at

    Hi,

    Sorry for disappearing. We're currently waiting for some person of our dev team to investigate on that error log so... I'll update the thread if I need something else. Thanks everyone!

    Gian Paolo

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans