This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following code shows a very simple class construct for the SysOperation framework. Without the Dataprovider and UIBuilder.
Service
class TutorialSysOperationService extends SysOperationServiceBase { }The method runService() is the actual service method. By means of the attribute SysEntryPointAttribute we control here that no further authorization checks are necessary.
[SysEntryPointAttribute(false)] public void runService() { info("Done"); }Controller
class TutorialSysOperationController extends SysOperationServiceController { }In the new()-method, we link the controller to the service class.
void new() { super(); this.parmClassName(classStr(TutorialSysOperationService)); this.parmMethodName(methodStr(TutorialSysOperationService, runService)); }The main()-method is the classic entry point when the controller is called via a MenuItem.
public static void main(Args _args) { TutorialSysOperationController controller; controller = new TutorialSysOperationController(); controller.parmArgs(_args); controller.parmExecutionMode(SysOperationExecutionMode::Synchronous); controller.startOperation(); }