Question Status

Suggested Answer
maram fraij asked a question on 13 Aug 2014 4:42 AM

I create  a class extended from RunBaseBatch to be used as  batch tack. I go to  System Administration > Inquiries > Batch Jobs to create new  batch then click view tasks to add tasks when I entered  the name of the created class to class name field in the grid I get the following error  “The batch task you entered is not valid. Enter a different batch task”.

 

 

I try  creating the batch by go to class directly select open then use batch tab to create batch and set recurrence. The batch is created, added to batch queue and performed successfully. When I check tasks related to this batch, I find the name of the class in the field class name.

 

 

Why I face such case ?

Reply
Suggested Answer
Martin Dráb responded on 13 Aug 2014 5:24 AM

To be able to create a batch in this way, your class must override canGoBatchJournal() and let it return true.

It's not related to your question, but it's worth noting that you shouldn't implement batches by the RunBase framework since AX 2012. Use the SysOperation framework instead (which makes many things easier, e.g. you don't have to implement serialization by yourself anymore).

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
Suggested Answer
Martin Dráb responded on 13 Aug 2014 6:26 AM

Well, there are other conditions and I can say (without ever seeing your code) which exactly is violated.

First restart the client to clear client cache. If it doesn't help, simply debug the code (in Batch.className()) to find out which condition is failing.

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
Suggested Answer
Martin Dráb responded on 13 Aug 2014 5:24 AM

To be able to create a batch in this way, your class must override canGoBatchJournal() and let it return true.

It's not related to your question, but it's worth noting that you shouldn't implement batches by the RunBase framework since AX 2012. Use the SysOperation framework instead (which makes many things easier, e.g. you don't have to implement serialization by yourself anymore).

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
maram fraij responded on 13 Aug 2014 6:05 AM

The method canGoBatchJournal is already overrite and return true since I use the class “Tutorial_RunbaseBatch” to create my new customized one.

Reply
Suggested Answer
Martin Dráb responded on 13 Aug 2014 6:26 AM

Well, there are other conditions and I can say (without ever seeing your code) which exactly is violated.

First restart the client to clear client cache. If it doesn't help, simply debug the code (in Batch.className()) to find out which condition is failing.

Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog

Reply
maram fraij responded on 13 Aug 2014 7:47 AM

By restarting  the client,  the problem is resolved.

Thank you very much.

Reply
maram fraij responded on 18 Aug 2014 4:08 AM

When creating a batch via System Administration > Inquiries > Batch , its status is by default “withhold”, the status should be changes to “waiting” in order to be started, right?

Another question, the batches in AX are similar to windows  services; they are running in the background, is it correct ?

Reply