Monday, September 19, 2011

Bug in the training material for AX 2012 Development II

In chapter 1, Introduction to X++, under Jobs you can find the following statement:
"... Jobs are used primarily for testing code during development and running batch processes within Microsoft Dynamics AX that affect large amounts of data".

Jobs are not in any way related to the batch capabilities of AX, and due to that fact that they are executed on the client, you'd never use a job to work with large amount of data.

I think the author somehow confuses the RunBase(Batch) framework with the Jobs node in the AOT.

You can find the same error in the course material for AX 2009.


Vlad said...

First of all, AX jobs can be run On Server, you just need to attach an Action menuitem to it with property RunOn set to Server (this behaviour didn't change since ver.3) and use it to run the job.

Secondly, "batch processing" term referes here in text does not refer to RunBaseBatch class but to the processing data without manual intervention which is often used for testing purposes.

Dynamics AX and surround said...

Job can be executed on server if menuitem for the job has property RunAt set to Server.
I suppose by "batch processes" author meant processes that are grouped by some property. For instance data migration scripts can be written as jobs.

Palle Agermark said...

Thank you for the very good comments.

I can however not think of a situation where you'd bother creating a menu item for a job. But, true, if you choose to do so and set execution to Server it will run on server. If you just open and execute it from the AOT it will run on the client.

My main concern is that this material is for new AX developers and this kind of ambigity won't really help them learn AX and good AX practices in my opinion.

Let me just add what MSDN has to say about Best Practice for jobs:
"Jobs work well for testing various things. They are not intended to be shipped as a part of a solution, and it is not possible to check them in to the application object tree (AOT) version control system. (You can only use them locally on your computer.)"