Looking at the subject there are lot of blogs available but I am writing this based on one of the request from my colleague.
Everybody aware of that whenever you developed an app it need to be extensible and if anybody would like to add or modify any field or additional routing we need to have events which can extend the base functionality.
Step 1 :- Simple Quick action to add event in Business Central
Next step will be we can subscribe the event and add you own code.
It is so simple to add custom event in AL and allow other to extend your functionality.
With the release of Business Central Wave 1 2020 new feature was introduced called ‘Interface’. It is basically syntactical contract that can be implemented by a non-abstract method. This allows for writing code that reduces the dependency on implementation details, makes it easier to reuse code.
Today we will see how to write an interface and implement in Business central.
For defining interface we no need to have object id.
If you can see in above interface we just define method but not programmed any business logic.
Now Lets see how to implement interface.
Added new code unit which implements the defined interface.
For checking the result of interface created following page with one function.
Above function to initialize the interface.
Lets check the result of interface.
Hope this will help you to understand interface and implementation.