General X++ Development
How do I create a SysOperation service in D365FO?
How do I create a SysOperation service in D365FO?
1 answer
Write an answerA basic SysOperation process normally has three pieces:
- Contract — parameters.
- Service — business logic.
- Controller — launches the operation.
Example service:
class MyOperationService
{
public void process(MyOperationContract _contract)
{
str value = _contract.parmValue();
// Do the work here.
}
}Keep the actual business logic in the service or a separate domain/service class. The controller should not become a 500-line business logic class.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer