How to start working with the Business Central Modern Development Environment

Download and install Visual Studio Code (VS CODE). The installation process is simple and quick.

Out of the box Visual Studio Code cannot work with the new development environment of Business Central. So the next thing to do is to extend VS Code by activating the AL Language extension. Please first check if you have installed the VS extension (by running the Business Central setup) before continuing on. If you don’t have this file you didn’t select the Extension during the BC Setup.

2019-01-21 16_00_01-bcs01 op irasoelbaks - verbinding met virtuele machine

If installed: Start VS Code, go to Extensions > Menu and select Install From VSIX. Browse to the location where the extension is installed. For example, ‘C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\130\AL Development Environment’ and press the Install button. The extension will now be installed. After the installation is completed click the ‘Reload Now’ button on the right bottom of your page. Now Close VS Code.

Install Extension.gif

Next we need to check the technical Business Central configuration first before we can move on:

Verify if ‘Enable Developer Service Endpoint’ is enabled on the server instance

2019-01-21 16_25_16-bcs01 op irasoelbaks - verbinding met virtuele machine

Next, check if the Web Client Base URL has been configured:

2019-01-21 16_48_37-bcs01 op irasoelbaks - verbinding met virtuele machine

Also check if you can start the Windows or Web Client in order to ensure a correct configuration of certain BC settings.

In VS Code now press CTRL+SHIFT+P to open the command palette and choose AL:Go! Now perform the following steps:

  • Choose a path to a new empty folder.
  • Choose the server: Your own server. Don’t choose Microsoft Cloud Sandbox because this howto article is based on an on-prem scenario.
  • Specify username: skip this step by pressing the ESC key
  • Specify password: skip this step by pressing the ESC key
configure extension

Configuration via the command palette:

After the above steps a new file has been created called launch.json. Please change line 7, 8, 9, 10:

Name: your servername
Server: http://your server address
Serverinstance: name of the serverinstance that runs the client services
Authentication: authentication type

In my case the new launch.json looks like this:

{

"version": "0.2.0",

"configurations": [

{

"type": "al",

"request": "launch",

"name": "BC01",

"server": "http://localhost",

"serverInstance": "BC130",

"authentication": "Windows",

"startupObjectId": 22,

"startupObjectType": "Page",

"breakOnError": true

}

]

}

After changing the file please save the changes. If you press F5 now you most likely will encounter an error, like this one:

The request for path /BC130/dev/metadata failed with code InternalServerError. Reason: NetFx40_LegacySecurityPolicy is enabled and must be turned off in the Microsoft.Dynamics.Nav.Server.exe.config file.

To fix this perform this change as well:

  • Backup this file first and then edit: “C:\Program Files\Microsoft Dynamics 365 Business Central\130\Service\Microsoft.Dynamics.Nav.Server.exe.config” and change true to false on line 36, so after changing it should look like this:
<NetFx40_LegacySecurityPolicyenabled="false"/>

Now restart the Server Instance to load the changes. Now open VS Code again or if opened already now press F5 to publish an extension on page 22. That’s it. If everything went well you should see something like this:

2019-01-21 21_25_33-bcs01 op irasoelbaks - verbinding met virtuele machine

This confirms the AL Development environment is installed and configured correctly.

Is the publishing failing? Troubleshooting steps:

  1. Is the server instance started?
  2. Is the development endpoint enabled?
  3. The service name matches the one specified in the URL?
  4. The port number matches the one specified in the URL?
Advertisements

How To Start working with the Business Central Development Environment

In this post I will demonstrate how to start the development environment, how to connect to a database and how to open the object designer.

First, start the development environment from the Start Menu:

open development environment

The Microsoft Dynamics NAV Development Environment is now started. In the menu bar (up in the left corner) now click File > Database > Open

2019-01-10 17_28_30-bcs01 op irasoelbaks - verbinding met virtuele machine

Now fill in the SQL Servername where the Business Central database resides. If you are using a named instance on your SQL server like I do please then also please specify the instance. After changing the Authentication to Windows Authentication you should be able to select the Business Central database:

2019-01-10 17_30_52-bcs01 op irasoelbaks - verbinding met virtuele machine

Now after pressing the OK button in the Open database window you will see the ‘plain old’ Object Designer.

2019-01-10 17_32_20-bcs01 op irasoelbaks - verbinding met virtuele machine

How to install Microsoft Dynamics 365 Business Central

In this post I will demonstrate how to install D365 Business Central (BC) on premises. In this how-to I will perform an installation from scratch, the only thing installed is the OS Windows Server 2019, SQL Server 2017 (on a dedicated VM) and SQL Server Management Studio.

Download the Product DVD ‘Download Microsoft Dynamics Business Central on premises‘ on ParnerSource.

In this post I’ve installed the Dutch version, CU (Cumulative Update) 1. The steps below are identical for the W1 version or other languages.

Extract the download to C:\Install\BC for example.

Now start the setup by running Setup.exe from the C:\Install\BC folder and Click Next.

2019-01-10 14_21_21-bcs01 op irasoelbaks - verbinding met virtuele machine

Now please accept the software license terms (SLT) by clicking ‘I accept‘.

2019-01-10 14_22_44-bcs01 op irasoelbaks - verbinding met virtuele machine

Choose Advanced installation options to get Business Central installed on your server.

2019-01-21 14_47_34-bcs01 op irasoelbaks - verbinding met virtuele machine

Click ‘Choose an installation option’, because ‘Install Demo’ will install SQL Server Express and everything else would be automated which means: no control. Please also mind the memory, CPU and database size limit that apply to SQL Server Express.

2019-01-21 14_48_38-bcs01 op irasoelbaks - verbinding met virtuele machine

Now select Custom to install only some essential components we need right now:

2019-01-10 14_32_57-bcs01 op irasoelbaks - verbinding met virtuele machine

Select AL Development Environment, Server Administration Tool, Server (partly), SQL Server Database Components, Web Server Components (Webclient), Dynamics NAV Client (Windows Client) and click Next.

Note: this customized installation is only performed for internal testing and research and this is ofcourse an all-in-one environment. In a serious production environment the options may differ depending on the needs and technical infrastructure and design!

2019-01-21 14_53_16-bcs01 op irasoelbaks - verbinding met virtuele machine

Last part of the page:

2019-01-21 14_54_55-bcs01 op irasoelbaks - verbinding met virtuele machine

Now specify the parameters like folder location, instance name etc. If you need to install BC a couple of times with the same parameters you could press the Save button to save the setup parameters to an XML file. This way you can import this saved file during setup on another machine so you don’t need to specify all the choices and parameters (again).

The parameters in the screenshot below are specific for my scenario and may be different for your scenario.

2019-01-21 15_07_26-bcs01 op irasoelbaks - verbinding met virtuele machine

Setup will now install the software.

install bc

When it’s completed you will see the following message. Now click ‘Close‘ to end the installation.

2019-01-10 15_28_46-bcs01 op irasoelbaks - verbinding met virtuele machine

After installation you will have the following shortcuts in your Start Menu:

2019-01-10 15_34_57-bcs01 op irasoelbaks - verbinding met virtuele machine