共用方式為


Batch Processing Classes

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Implement classes by using the batch processing system, and by extending the RunBase and the RunBaseBatch classes.

Remove the Recurrence button from the Batch processing dialog by using the Args::parmEnum method. For more information, see the procedure later in this topic.

It is recommended that you designate a class to run as a server-bound batch job. Server-bound batch jobs are more secure than jobs that are not server-bound batch for the following reasons:

  • The job executes by using the permissions of the user who submitted the job.

  • The job can interact with the Microsoft Dynamics AX client, which is processing the job, by using only certain Info and Global class methods. This limits interaction with the client.

Enable a Class to Run as a Server-Bound Batch Job

  1. Create a class that extends the RunBaseBatch class.

  2. Override the RunBaseBatch.runsImpersonated method to return a value of true, as shown in the following example.

        public boolean runsImpersonated()
        {
            return true;
        }
  1. Confirm that the class calls only the following Info and Global class methods:

    The Info.line and Info.num methods are inherited from the xInfo class.

Remove the Recurrence Button from the Batch Processing Dialog

When you implement a class by using the batch processing system, call the Args.parmEnum method, and pass the NoYes::Yes system enumeration value to remove the Recurrence button.

The NoYes system enumeration determines whether the recurrence button is removed from the batch processing dialog. The default value is NoYes::No.

In the following code example, the InventTransferMultiShip class is implemented. The BatchDialog::main method creates the Batch processing dialog.

static void noRecurrenceButton(Args _args)

{

Args a;

InventTransferMultiShip inventTransferMultiShip;

;

a = new Args();

inventTransferMultiShip = InventTransferMultiShip::construct();

a.caller(inventTransferMultiShip);

a.parmEnum(NoYes::Yes);

BatchDialog::main(a);

}

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.