General X++ Development
How do I extend a class using Chain of Command?
How do I extend a class using Chain of Command?
1 answer
Write an answerCreate an extension class and wrap the method with the same signature.
[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.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer