Tags

, , , ,

HI Guys,

To create a batch with the help of sysoperation is explained very good at the below URL’s.

http://www.artofcreation.be/2011/08/22/ax2012-sysoperation-part-1-data-contracts-and-service-operations/

http://www.artofcreation.be/2011/08/23/ax2012-sysoperation-part-2-sysoperationservicecontroller/

But with little change in the controller class.

Edit the controller class (KlForCustTesterServiceController ) as follows.

Decorate the controller class with [SysOperationJournaledParametersAttribute(true)]

————-

 

[SysOperationJournaledParametersAttribute(true)]

class KlForCustTesterServiceController extends SysOperationServiceController
{
}

————-

public static void main(Args _args)
{
KlForCustTesterServiceController klForCustTesterServiceController;
;
klForCustTesterServiceController = KlForCustTesterServiceController::newFromArgs (_args);

klForCustTesterServiceController .parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
klForCustTesterServiceController.startOperation();
}

————–

Now override the New method.

public void new()

{

super();

this.parmClassName(ClassStr(KlForCustTesterDataService));

this.parmMethodName(MethodStr(KlForCustTesterDataService, testCustomer));

}

Basically, to create any batch job with sysoperation

  1. controller class must be decorated with [SysOperationJournaledParametersAttribute(true)]
  2. Main method should have  – – – – – –  klForCustTesterServiceController .parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
  3. New method should be overridden –  – – – After super(), pass the class name and method of the service class.

These three things are very important and explained very good at the below URL.

https://msdax.wordpress.com/2016/06/03/sys-operation-framework-adding-class-to-batch-taskmaking-journalized/

Would like to thanks Martin Drab and Amir Nazim for this valuable information.

Thanks.

 

 

Advertisements