Skip to main content

Posts

Control Add-in in Business Central

How to use Control Add-In in Business Central? I have come across with Control Add-In once one of our customers wants have custom layout for their sales. I was searching that how we can fulfill their requirement in the business central. I have gone through several blogs regarding my requirement. At the end, I have found that we can achieve this with the help of Control Add-In in the business central. We can use Control Add-In to integrate Java Script with AL in the business central. Moreover, we can do some stuff related to UI with the help of Control Add-In . https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-control-addin-object I think Microsoft has given good documentation on Control Add-In in business central. We can easily understand how we can use this for our requirement. Basically, it has main two things in Control Add-In . One is define event in Control Add-In, which will use to call AL from Java Script. Another thing is define proce
Recent posts

SetLoadFields in Business Central

How to Use SetLoadFields in Business Central? SetLoadFields is an amazing feature of business central wave 2 2020. Conventionally, we are used to load all fields together whenever we are going to retrieve records from table. At that moment, I suppose it uses Select * From Table query in the backend. So, it will take little bit more time to fetch the data. We can reduce this time with the help of  SetLoadFields when we use this function. I suppose it will use Select Field From Table query to fetch the data. This will impact a lot as far as performance is concerned. Also, we can use  SetLoadFields with Setrange and Setfilter to get our desire records. Here, I have used  Setfilter  along with  SetLoadFields. pageextension   50100  CustomerListExt  extends  "Customer List" {      trigger  OnOpenPage () ;      var         Item:  Record  Item;         total:  Decimal ;      begin         Item . Reset () ;         Item . SetFilter ( "No.",  '%1|%2' ,  '1953-W&#

Business Central: obsoleting WITH statement

Today, I have been checking some of my extensions for business central 17 compatibility. Majorly, I found that it is giving a warning for with statements. After that, I checked some blogs on the google and found that it is going to be obsolete soon in the newer version of business central. With clause can help us to write a more readable source code for our customization. In fact, Microsoft is already using this with clause many times the we have seen in the Navision as well as in the business central. We have to change our code for solving this problem as soon as possible. Many people are asking that it is just a warning why we need to take care today but my answer is always to change your code as earliest as possible for not creating mess at the deadline. I hope you will understand the seriousness of handling With clause. After changing code when you compile source you will not get a warning for code AL0606.

Protected Variable in AL

If you want to make a global variable accessible from table to table extension, or from page to page extension, you would normally need to create a procedure to get or set the variables. With protected variables, you no longer need to do that. The protected keyword can be used to make variables accessible between tables and table extensions and between pages and page extensions. If you want to only expose some variables as protected, you must create two sections of variables declarations. Let’s give an example. I have a core extension with a new page called “My Item List”. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 page 70102 "My Item List" {        Caption = 'My Item List';      PageType = List;      SourceTable = Item;        layout      {          area(content)          {              repeater(General)              {                  field("No."; Rec."No.")                  {                      Applicat