All class member variables are protected by default in AX 7, so it is impossible to access them from extensions. It becomes a real problem when you try to extend classes like SalesLineType.
For example, we want to add custom logic on sales line insert event. Call to super() is commented out so we cannot create pre or post event handlers. We may try to create event handlers for SalesLineType.insert() mehtod, but we won’t get access to salesLine buffer because this variable is protected.
There are two options: use overlaying or use reflection.
Overlaying is preferable approach, but today we will talk about reflection to explain this option.
Reflection is usually used for unit testing in cas