Implement The SysOperation Framework
Implement The SysOperation Framework
The SysOperation framework replaces the older RunBase framework, and it provides
more extensibility. Both frameworks support the following capabilities:
Parameters
Dialog user interface (UI)
Batch servers
Running operations interactively
For finance and operations apps, we recommend that you use the SysOperation
framework instead of the RunBase framework. Use SysOperation framework when a
job should process or calculate something.
The Data contract class indicates the attributes that are needed for the job, and the
attributes automatically provide a dialog-based UI. The following code sample
illustrates the Data contract class:
X++Copy
[DataContractAttribute]
internal final class MySysOperationContract
{
private ItemId itemId;
return itemId;
}
}
Controller class
The Controller class is the execution class, which contains information about the
dialog, execution mode, progress bar, and other elements. The following code
sample illustrates the Controller class:
X++Copy
internal final class MySysOperationController extends
SysOperationServiceController
{
protected void new()
{
super(classStr(mySysOperationService), methodStr(MySysOperationService,
process), SysOperationExecutionMode::Synchronous);
}
return controller;
}
controller = MySysOperationController::construct();
controller.parmArgs(_args);
controller.startOperation();
}
}
Service class
The Service class is the actual code that's processed or calculated. The following
sample code illustrates the Service class:
X++Copy
internal final class MySysOperationService extends SysOperationServiceBase
{
public void process(MySysOperationContract _contract)
{
// do something
UI Builder class
The UI Builder class is only needed if the UI requires modification from the
dynamically generated UI or if it has custom behavior.
You can create a new table for your new fields, as the following image depicts.