How to Create Custom Event in Business Central

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.

Hope this will help you.

Stay tuned for more updates.

How to convert long code into Procedure in AL/Business Central.

With the different code actions it is very easy to convert your long code into procedures. Just a small tip to convert to your long code into smaller procedures.

To enable to code actions

Hope this will help you.

Stay tuned for more.

How to find Table Relation in Business Central.

With the release of business central new property is introduced to find the table relation of given field. This property is called as’ Relation’ which returns integer value

Lets see how we can find that .

To make it created one page extension and added one action button to display the value of table of given field.

If you see the highlighted area where in I have used relation property to find table id of CITY field of customer table.

Output of this simple code as follows

Hope this will help you

Stay tuned for more..

How to Implement Interface in Business Central

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.

To understand more on differentiate between events and interface read Interface Vs Events..

Stay tuned for more…

Cumulative Update for Business Central Wave 1 2020

Cumulative Update includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics Business Central

Business Central Wave 1 2020 (16.2) :- 16.2

Warning

Before you install a cumulative update in a production environment, take the following precautions:

  1. Test the cumulative update in a non-production environment.
  2. Make a backup of the system or computer where the cumulative update is to be installed.

Stay tuned for more updates…

How to extend TableRelation Property-Business Central

Last week somebody asked me on can we extend table relation property and my answer was yes we can achieve this by table extension.

Today we will see how we can do that

Firstly create enum extension and extend as follows . For this demo I used Type field from Sales line table.

enumextension 50145 PlaySaleDocType extends "Sales Line Type"
{
    value(8; Retail)
    {
        Caption = 'Retail';
    }
}

Secondly create a table extension and modify required table relation property.

tableextension 50146 PlaySalesTabRelExt extends "Sales Line"
{
    fields
    {
        modify("No.")
        {
            TableRelation = if (type = const(Retail)) Retail;
        }
    }

}

Hope this will help you.

Stay tuned for more update.

Business Central:- How to find Events in AL

With the release of Business Central 2020 Wave 1 and AL extension lot of new features has been added to make AL development more productive.

A core part of extension-based development is the use of events and event subscribers. Use the new Shift+Alt+E shortcut in the AL code editor to invoke a list of all events.

Hope this will help you

Stay tuned for more.

Business Central 2020 Wave 1: New CodeCops

With the release of Business Central 2020 Wave 1 and AL extension new codecops added for more information and making your app more prominent

AA0215 – Checking file naming

This checks file name as per new guidelines and shows warning as below

Following are the new guidelines for this warning

Object NameFile Name
Codeunit 50000 “Post Bank Details”PostBankDetails.Codeunit.al
Page 50000 “Customer Card Ext”CustomerCard.PageExt.al

To Get this done automatically use Waldo’ CRS extension

AA0218,AA0219,AA0218 – Missing and Wrong ToolTips

This will show warning for missing Tooltips as below

AA0470- Comments in Labels

Placeholders should have a comment explaining their content.Provide an explanation that describes the content of each of the placeholders.

To fix this Adding the comment

There are more code analyzer added and you can find this from following link

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/codecop

Stay tuned for more ….

Cumulative Update for Business Central Wave 2

Cumulative Update includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics Business Central Wave 2 2019 Release

Download update from below

Update 15.3 for Microsoft Dynamics 365 Business Central 2019 Release Wave 2

Warning

Before you install a cumulative update in a production environment, take the following precautions:

  1. Test the cumulative update in a non-production environment.
  2. Make a backup of the system or computer where the cumulative update is to be installed.

Stay tuned for more updates…

Business Central 2020 Wave 1

Microsoft reveals plan for business central with upcoming release 2020 Wave 1

This release comes with lot of new enhancement and features which will make business central more fun to work with.Listing few of them features.


AL interfaces
https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/al-interfaces
Look up events and insert event subscriber in codehttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/lookup-events-insert-event-subscriber-code
Ability to refactor a field from a table to a table extensionhttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/ability-refactor-field-table-table-extension
Application version for aliasing base applicationhttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/application-version-aliasing-base-application
Enhanced customer and vendor document layouthttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/enhanced-customer-vendor-document-layout
Multiple languageshttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/multiple-languages
Expanded country and regional availabilityhttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/expanded-country-regional-availability
Migrate data from Business Central 14.x on-premises to Business Central 15.x onlinehttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/migrate-data-business-central-14.x-on-premises-business-central-15.x-online
Disable export of data to Excelhttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/disable-export-data-excel
Improved load time for pageshttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/improved-load-time-pages
Improvements to data entryhttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/improvements-data-entry

Unhide parts on a page
https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/unhide-parts-page

Import profiles and UI customizations
https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/import-profiles-ui-customizations
Business Central integration with Common Data Servicehttps://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/business-central-integration-common-data-service

Collapse and expand document lines
https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/collapse-expand-document-lines

Looking forward for this change.

For more details visit

https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave1/dynamics365-business-central/planned-features