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.
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
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
Sign in your Gmail account which you are using in business central.
Click on Manage your google account
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.
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.
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
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.
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.
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.
Business Central in Microsoft Teams :-Integrate Microsoft team with Business Central.
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.
Data audit system fields are added to every table :- Four New Field will be added in every tables to track the transactions log.
SystemLastModifiedOn
SystemLastModifiedBy
SystemCreatedBy
SystemCreatedOn
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.
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
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.
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..