General X++ Development

How do I create and use an abstract class in X++?

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

How do I create and use an abstract class in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

Create an abstract base class when implementations should share behavior or state but still provide their own implementation for part of the process.

X++
abstract class MyProcessorBase
{
    public abstract void process();

    public void logStart()
    {
        info('Starting.');
    }
}

A derived class then implements process().

Use an interface when you only need a contract. Use an abstract class when there is actual base behavior worth sharing.