General X++ Development

How do I create a batch job in D365FO using X++?

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

How do I create a batch job in D365FO using X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

You have a few options, but for new parameter-driven business processes I normally use SysOperation.

The usual structure is:

  1. Data contract — parameters.
  2. Service class — actual work.
  3. Controller — starts the operation and controls execution mode.

Example service:

X++
class MyBatchService
{
    public void process(MyBatchContract _contract)
    {
        // Batch logic.
    }
}

RunBaseBatch is still supported and is used all over standard D365FO, so it is not "wrong." I just would not automatically start new development there if SysOperation fits the requirement better.