How to create an X ++ batch job in Axapta 3.0?

I would like to create a batch job in X ++ for Microsoft Axapta 3.0 (Dynamics AX).

How to create a task that performs an X ++ function like this?

static void ExternalDataRead(Args _args) { ... } 
+4
source share
1 answer

Here is the minimum minimum required to create a batch job in AX:

Create a batch job by creating a new class that extends the RunBaseBatch class:

 class MyBatchJob extends RunBaseBatch { } 

Implement the abstract pack() method:

 public container pack() { return connull(); } 

Implement the abstract unpack() method:

 public boolean unpack(container packedClass) { return true; } 

Override the run() method with the code you want to execute:

 public void run() { ; ... info("MyBatchJob completed"); } 

Add the static main method to your class to instantiate your class and call the standard RunBaseBatch dialog:

 static void main(Args _args) { MyBatchJob myBatchJob = new MyBatchJob(); ; if(myBatchJob.prompt()) { myBatchJob.run(); } } 

If you want your batch job to contain a description in the list of lots, add the static description method to your class:

 server client static public ClassDescription description() { return "My batch job"; } 
+8
source

Source: https://habr.com/ru/post/1277468/


All Articles