最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Dynamics Ax creating a batch job from code

网络文摘 Kevin Roos 1596浏览

Hi,

Here is a simple code snippet to create Batch jobs from code. This convenient when starting a heavy load job from a user interface and still keep the client responsive.

TSTSalesOrderUpdate tSTSalesOrderUpdate;
 
BatchInfo           batchInfo;
BatchHeader         batchHeader;
;
 
tSTSalesOrderUpdate = TSTSalesOrderUpdate::construct();
 
batchInfo   = tSTSalesOrderUpdate.batchInfo();
batchInfo.parmCaption("Test from code");
batchInfo.parmGroupId("");
 
batchHeader = BatchHeader::construct();
batchHeader.addTask(tSTSalesOrderUpdate);
batchHeader.save();