AX2012 batch process using sysOp

2017-12-30  本文已影响0人  axxxxxxxx

Example : https://stoneridgesoftware.com/batch-processing-in-dynamics-ax-2012-using-sysoperation-framework/

first , define a controller

class ACT_ProcessMessageLogController extends SysOperationServiceController
{
    #define.ToDate('toDate')
}
public static ACT_ProcessMessageLogController construct(SysOperationExecutionMode _mode = SysOperationExecutionMode::Synchronous)
{
    ACT_ProcessMessageLogController    controller;
    ACT_ProcessMessageLogContract      contract;
    ;

    controller = new ACT_ProcessMessageLogController(classStr(ACT_ProcessMessageLogService),
                                                     methodStr(ACT_ProcessMessageLogService, processMessages),
                                                     _mode);

    controller.parmDialogCaption(literalStr("QC Scheduler Job"));
    contract = controller.getDataContractObject();
    contract.parmToDate(systemDateGet()+1);

    return controller;
}
public static void main(Args args)
{
    ACT_ProcessMessageLogController controller = ACT_ProcessMessageLogController::construct();
    ;

    controller.startOperation();
}

second, defind a contract:

[
    DataContractAttribute
]
class ACT_ProcessMessageLogContract
{
    TransDate   toDate;
}
[DataMemberAttribute,
 SysOperationLabelAttribute("@SYS35904")]
public TransDate parmToDate(TransDate _toDate = toDate)
{
    toDate = _toDate;

    return toDate;
}

third ,denfie service and entry point


image.png
上一篇下一篇

猜你喜欢

热点阅读