Skip to main content

Posts

Showing posts from April, 2020

Interface in AL

Interface in AL ·Interface in AL is an exciting feature of the BC 2020 wave 1 release. ·Interface is an Oops concept which is already being used in other programming languages like c#, java, python, etc. ·Interface in AL is implemented by non-abstract methods. ·Interface supports polymorphism and code reusability. ·We can create interface using tinterface, which will create basic layout for the interface where we can add signature because interface does not support any logic and it is implemented by other objects. ·Codeunits that implement the interface methods, must use the implements keyword along with the interface name(s). 
 Example This is the way you can create interface. interface IAddressProvider {     procedure GetAddress(): Text; }
This is the way you can implement interface in the codeunits. codeunit 50191 CompanyAddressProvider implements IAddressProvider {     procedure GetAddress(): Text;
    begin         exit('Company address \ Denmark 2800')     end; } codeunit 50192 PrivateAddre…

Page Background Task in BusinessCentral

This week I explored the page background task in the business central. Let's have a quick look what is the page background task?

A page background task is a child session that runs processes from a codeunit in the background, letting the user continue working on the page while the task runs. It is similar to other background sessions, except that when the process completes, the child session is terminated, and the parent session is notified with results of the task. To improve the performance of a page, you can develop the page to run read-only computations and long processes asynchronously in background tasks.


Page Background Task Characteristics: ·Performs read-only operations; it cannot write to or lock the database. ·Runs on the same Business Central Server instance as the parent session. ·The parameters that are passed to and returned from page background task are in the form of a dictionary<string, string>. ·Calls OpenCompany and executes in its own transaction. ·The callbac…