General X++ Development
How do I create a batch job in D365FO using X++?
How do I create a batch job in D365FO using X++?
1 answer
Write an answerYou have a few options, but for new parameter-driven business processes I normally use SysOperation.
The usual structure is:
- Data contract — parameters.
- Service class — actual work.
- Controller — starts the operation and controls execution mode.
Example service:
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.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer