Using Interfaces in AL
In object-oriented programming, an interface is a syntactical contract used to define the capabilities available for a given object, hiding the implementations of these capabilities. Interfaces are a way to achieve polymorphism and they permit you to write code abstract from the implementation details.In AL language, interfaces are useful to define business processes that can be substituted by other extensions. When using interfaces in AL, you need to:Define an interface object (the contract) that only contains methods definitions (no code).Define the implementation of this interface (in a codeunit object that implements the interface).How can we use interfaces in AL to re-create our previously defined business process for calculating item charges for shipment commissions of sales orders?As a first step, by using the tinterface ALlanguage extension’s snippet we create the following interface object:
interface "PKT IShipmentCommissionCalculation"...