Create a data contract class
[DataContract]
class AcxSysOperationContract
{
PurchId purchId;
[DataMemberAttribute("PurchId")]
public PurchId parmpurchId(PurchId _purchId = purchId)
{
purchId = _purchId;
return _purchId;
}
}
Create a service class where you will place your custom business logic
class AcxSysOperationService
{
public void operation(AcxSysOperationContract _dataContract)
{
info(_dataContract.parmpurchId());
//your business logic
}
}
Create a controller class
class AcxSysOperationController extends SysOperationServiceController
{
public static void main(Args args)
{
AcxSysOperationController sysOperationController = new AcxSysOperationController();
sysOperationController.parmClassName(classStr(AcxSysOperationService));
sysOperationController.parmMethodName(methodStr(AcxSysOperationService, operation));
sysOperationController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
sysOperationController.startOperation();
}
}
2 thoughts on “D365/AX7: Create A Batch Job Using SysOperation Framwork”
Thanks for the post. Just wanted to let you know there is one error (might be typo) in contract class. ‘purchId’ should be return in place of ‘_purchId’.
Microsoft Dynamics AX, Microsoft Dynamics 365 for Finance and Operations, D365 FO, Retail, SQL, Microsoft Power Apps, Microsoft Power BI, Microsoft Azure, Logic Apps, Microsoft Flow, Microsoft power automate, Microsoft Power Platform,.Net, X++, C#, Power BI DAX, Data Warehousing, Microsoft Analysis Services, SQL Server Reporting Services
Thanks for the post. Just wanted to let you know there is one error (might be typo) in contract class. ‘purchId’ should be return in place of ‘_purchId’.
on what basis this batch job has been created could you please explain ?