Using the SysOperation framework execution modes

We can also use the controller programmatically, without the dialog. For this, we need to interact with the contract and decide how it will be executed.

One of the benefits of this framework is that we can execute the code asynchronously or add it to a batch queue. To demonstrate this, we need a test class so that we can call the controller programmatically. To do this, create a new class called ConFMSSysOpTest, then create a main method, and enter the following lines of code:

public static void main(Args _args) { ConFMSVehicleGroupChangeController controller; ConFMSVehicleGroupChangeContract dataContract; ConFMSVehicleId vehicleId; ConFMSVehicleGroupId groupId; ConFMSVehicleTable firstVehicle; ConFMSVehicleGroup ...

Get Mastering Microsoft Dynamics AX 2012 R3 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.