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 extend enum in Business Central

With the release of Business Central 2020 Wave 1 lot of new features has been added to make product more prominent.

Though this concept of ENUM was introduced earlier but from new version onwards most of the option fields are available as extensible enum such as follows

If define enum is extensible then we can add more option values in that field.

How to add the new option value in existing enum field.

First create extension for enum as below

To check the value just added one action button as below

To check the output publish the app and check

Select the document type and check the result as follows

Hope this help you…

Stay tuned for more..

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

Business Central Wave 1 2020 Released

MS released the major version of business central Wave 1 2020 on 1st April 2020

You can download the on-premise from following URL

Few Links to follow

Download BC 2020 Wave 1

What’s New and Planned for business Central

Features Not Implemented On-Premise

AL Language extension update

Stay Tuned for more updates.

Business Central :How to Customize Base App

This blog explains how to customize the base app of business central (old fashion) .

Please Don’t customize the base app, Use extension wherever possible

Step 1 :- Copy Base Application from installer

Step 2 :- Unzip in designated folder .This contains app.json file where in target set to onprem

app.json will look like this

Step 3 :- Download the symbols

Step 4:- Add the following in either user settings/workspace settings . This is required for .NET DLL used in application

Step 5 :- Unpublish the base application and dependencies or else you will get an error stating that extension already deployed on tenant

Use following PowerShell command

Unpublish-NavApp -Name “Base Application” -ServerInstance BC150

Step 6:- Import license file and publish the modified app.

Hope this will help you.

Business Central : Deprecated and Obsolete Fields

With the new version of business central wave 2 ,number of fields have been deprecated or obsolete

1) Fields moved to an extension by Microsoft

2) Fields marked as Obsolete:Pending

3) Fields no longer in use in Microsoft code

Impact of this is to refactor your solution as soon as possible

For more information of which field get deprecated visit this link Deprecated Fields

Hope this will help you…

Business Central 2019 Spring Release Available to Download

While Directions Asia 2019 getting wrap up we have spring release of Business Central available to download

You can download from following links

Microsoft Business Central Spring 2019 Release

Lets try and blog about new features

Cheers

How to upload File from URL using Extension in Business Central

Today we will see how we can upload picture from live URL on item card with extension.

For the above process created extension by extending item card.

Lets see how extension work to upload the picture from URL.

  1. Create new AL file with required name and by using page extension snippet extend Item card Page as below

2. Create a function to upload the file 

In the above function used HttpClient and HttpResponseMessage method to upload the file from URL.

3. Call this function on action on item card 

While passing parameter in function passed directly the URL from where I need to upload the picture on item card.

4. Compile and publish the extension and check the result.

5. Once you click on Upload file it will automatically upload the picture from URL on Item card.

This way you can upload the picture from URL rather than downloading on local drive and upload.

Isn’t it cool..

How Do I Upgrade to Business Central (on-premise)

Here are steps to upgrade to Business central .This is old way that is merging the objects into standard objects . Anyway not recommended to do this and it is better to create extension and publish it

Listed here some of the steps to upgrade business central from NAV 2018

  1. Merge all customization of old database to business central on-premises. Merging can be done using PowerShell(recommended) or manually (not recommend)
  2. Rectify all the errors and keep the object ready for upgrade.
  3. Take full SQL backup of old database.
  4. Install the Business Central from DVD.
  5. Uninstall allthe existing extensions from old database.
  6. Upload business central partner license into the old database.
  7. Delete all object except tables from old database.
  8. Clear all server instance and debugger breakpoints records from the old database.
  9. Make sure user with whom upgrade is carried out should have privileges of DB_Owner in Sql.
  10. Open business central development environment as an Administrator.
  11. Open the old database in Business central, which will ask for convert.
  12. Skip the schema synchronization at this point of upgrade.
  13. Import the upgraded objects on converted database in business central with selection of Replace All.
  14. Skip the schema synchronization at this point of upgrade.
  15. Import appropriate upgrade code unit from product DVD.
  16. Connect new database to appropriate NAV service.
  17. Increase SQL command time out to maximum number.
  18. Compile all objects with schema synchronization.
  19. Execute data upgrade process and import permission set.
  20. Make pages searchable by using ‘Build object search Index’ option from developer environment.
  21. Remove all unwanted objects
  22. Get Ready to face customer queries from new database