如何创建 X++ Axapta 3.0 中的批处理作业?

发布于 2024-07-06 20:56:45 字数 171 浏览 6 评论 0原文

我想在 X++ 中为 Microsoft Axapta 3.0 (Dynamics AX) 创建批处理作业。

我如何创建一个执行像这样的 X++ 函数的作业?

static void ExternalDataRead(Args _args)
{
...
}

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

How can I create a job which executes an X++ function like this one?

static void ExternalDataRead(Args _args)
{
...
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱你是孤单的心事 2024-07-13 20:56:45

以下是在 AX 中创建批处理作业所需的最低限度:

通过创建扩展 RunBaseBatch 类的新类来创建批处理作业:

class MyBatchJob extends RunBaseBatch
{
}

实现抽象方法 pack()

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

实现抽象方法 unpack()

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

使用您想要执行的代码覆盖 run() 方法:

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

将静态 main 方法添加到您的类来创建类的实例并调用标准 RunBaseBatch 对话框:

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

如果您希望批处理作业在批处理列表中具有描述,请添加一个静态 description 方法你的班:

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

Here's the bare minimum needed 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 method pack():

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

Implement the abstract method unpack():

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 a static main method to your class to create an instance of 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 have a description in the batch list, add a static description method to your class:

server client static public ClassDescription description()
{
    return "My batch job";
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文