General X++ Development

How do I create a SysOperation service in D365FO?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I create a SysOperation service in D365FO?

SSunny Vasty75 reputation · answered Aug 13, 2026

A basic SysOperation process normally has three pieces:

  1. Contract — parameters.
  2. Service — business logic.
  3. Controller — launches the operation.

Example service:

X++
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.