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.

Advertisement

How to create Custom Notification in Business Central

This blog post I am writing based on request of one of the follower.

Even though notification is not new business central world but today we will see how we will write custom notification and get notified for certain validations.

To create notifications I added following simple scenario that when my page get opened it should show some notification.

Lets see how we can do this.

To generate this notification I have used customer list page and subscribe on OnOpenPageEvent to execute my notification.

In this notification whenever page will get open it will show notification and whenever user click on Contact Us it will redirect to my blog.

Once this piece of code is published and as soon as customer list page opens you will see the result of notification as below

Hope this will help you.

Stay tuned for more..

How to Setup SMTP Mail Using Gmail in Business Central

Recently I encounter this issue as one of the customer would like to set up Gmail as service provided for SMTP mail in business central.

So I started the regular way how we started setting up SMTP and encounter the following issue.

Initial Setup :-

Did the initial setup with required details and while key in I key in the regular password which used while signing in Gmail.

When I click to Test Email setup and encounter the following error.

Now question is how get over this issue as it is something like you have entered some wrong password and you are getting this issue. After investing some hours I found the crucks for this issue as we need to generate App Password

This issue is encounter because of the Gmail security which required to authenticate the app which is going to use Gmail id.

To do this we need to do following

  1. Sign in your Gmail account which you are using in business central.
  2. Click on Manage your google account
  3. Go to Security.

4. Click on App Passwords to generate the app password (Need to enable 2-Step Verification first).

5. Select the required App and Device as below

6. Click on Generate to generate the App Password and you will get as follows

Now go back to business central SMTP Setup and key in this App password instead of regular passwords.

Now again test the email setup and you will happy to see this message and email.

Email in you inbox

Hope this will help you…

Stay tuned for more…

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.

Cumulative Update for Business Central July 2020

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

MS Dynamics Business Central 2020 Wave 1 (BC16) :- CU 16.3

MS Dynamics 365 Business Central 2019 Release Wave 2(15.8) :- CU 15.8

Business Central Spring Release (BC14) :- CU14

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 Wave 2 2020 Upcoming Features

By writing this I feel that clock is running faster and till the time we are utilizing the features of Wave 1 2020 more new features are planned and about to release in upcoming version Wave 2 2020.

There are plenty of features are planned for Wave 2 2020 but will list here what are the features I am looking for.

  1. Database access intent changed to read-only for frequently used reports As business required faster access to the information so to speed up default database access change to Read-only.
  2. Notify users of high-risk changes in selected setup fields :- This features means we can make list of fields from master table and get notified when someone changes.
  3. Business Central in Microsoft Teams :-Integrate Microsoft team with Business Central.
  4. Page Inspector supports temporary tables :- With this update, the inspection pane now displays valuable record information also for pages that are implemented to use temporary tables. Information about the current record is displayed in a consistent way and is not different from inspecting pages that use physical source tables.
  5. Data audit system fields are added to every table :- Four New Field will be added in every tables to track the transactions log.
    1. SystemLastModifiedOn
    2. SystemLastModifiedBy
    3. SystemCreatedBy
    4. SystemCreatedOn
  6. Attach to user session when debugging in sandbox :-Currently, when you debug with the Visual Studio Code AL debugger, you cannot attach to a user session, making it much harder to troubleshoot issues that are dependent on users and user permissions. This feature enables attaching to an active user session on the sandbox.
  7. Debug extension installation and upgrade code :- It is currently not possible to debug extension install or upgrade code by just adding breakpoints and deploying a new application. Instead, some workaround is required to manually trigger the install and upgrade code, possibly commenting out upgrade tags and so on, making it tedious to properly test install and upgrade during development, as well as to troubleshoot issues.

For More information on Planned features please check this link

What New and Planned for Dynamics 365 Business Central

Hope this will help you

Stay tuned for more updates.

Cumulative Update Summary July 2020

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

Microsoft Dynamics NAV 2018 CU 31 :- NAV2018CU31

Microsoft Dynamics NAV 2017 CU 44 :- NAV2017CU44

Microsoft Dynamics NAV 2016 CU 57 :- NAV2016CU57

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 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…