General X++ Development
How do I extend a protected method in X++?
How do I extend a protected method in X++?
1 answer
Write an answerProtected methods can be wrapped with Chain of Command when the method is wrappable.
[ExtensionOf(classStr(MyClass))]
final class MyClass_Extension
{
protected void processInternal()
{
next processInternal();
// Additional logic.
}
}Extension classes can also access protected members of the augmented class.
Private members are still private. CoC does not magically make them accessible.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer