General X++ Development

How do I extend a class using Chain of Command?

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

How do I extend a class using Chain of Command?

SSunny Vasty75 reputation · answered Aug 13, 2026

Create an extension class and wrap the method with the same signature.

X++
[ExtensionOf(classStr(MyClass))]
final class MyClass_Extension
{
    public void process()
    {
        next process();

        // Your logic.
    }
}

The base method needs to be available for wrapping, and your wrapper signature has to match it.

Do not copy the original method into your extension. Let next run the chain.