Quantcast
Viewing all articles
Browse latest Browse all 17314

My Custom Batch class in not appear in task list ?

 

If you consider my last post about creating, deploy and debug the custom batch job In Dynamics Ax 2012.

http://tech.alirazazaidi.com/exploring-the-batch-job-process-in-dynamics-ax-2012-r3/

 

I used X++ job to deploy the batch class as batch process.  But if we have to provide functionality that any person can schedule the class as batch from Dynamics Ax front end. We have to overwrite the canGoBatchJournal() in Class code. The default implementation comes with false return value so Job did not appear in Task List.

 

The complete code of class should be appear something like

 

class ProcessTableIncrement extends RunBaseBatch

 

{

 

 

 

}

 

 

 

publiccontainer pack()

 

{

 

returnconNull();

 

}

 

 

 

publicvoid run()

 

{

 

 

 

// The purpose of your job.

 

TblBatchHit _hit;

 

 

 

_hit.HitBy ="BatchJob";

 

_hit.hitTime= DateTimeUtil ::utcNow();

 

_hit.insert();

 

}

 

 

 

publicboolean unpack(container packedClass)

 

{

 

returntrue;

 

}

 

boolean canGoBatchJournal()
{

return true;
}


 

 

Now Generate Increment CIL. Close clients on Dynamics and reopen client Dynamics Ax.

 

Image may be NSFW.
Clik here to view.
fffed

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 17314