Although encapsulation is considered one of the four cornerstones of OOP it is not limited to this, and can be implemented in Dynamics NAV as well. When implementing encapsulation, we hide the components from being wrongly used.
In other words, we indicate to other developers which functions can, or cannot be used outside the class, or as in Microsoft Dynamics NAV, the object.
This is achieved by implementing the local functions. Microsoft Dynamics NAV allows functions to be global or local. Global functions are allowed to be called from outside the object; local functions can only be used inside an object. In C#, these would be public and private functions.
When we want a function to be local, traditionally in C/AL we have to explicitly set the property. However, this has changed in Microsoft Dynamics NAV 2015. In this version, all the functions are explicitly set to local, and as developers, we have to change the property to No if we want the function to be...