web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / My NAV Notes / AL Development in Business ...

AL Development in Business Central – Part 3 (Connect, Download symbols, Extend a page and Publish as extension)

Community Member Profile Picture Community Member

Now that we have VS Code with the required AL Extension we can now connect to the BC environment.

Open VS Code

Pres [F1] in VS Code and type AL:Go! and press the [Enter] key

AL: Go! in VS Code

Accept the default path by pressing [Enter]
Select the target platform ‘5.0’ Business Central 2020 release Wave 1:


Target platform list in VS Code

A new project has now been created (with an app.json file). Select ‘Your own server’ since my posts are based on an onprem environment, but if you are using BC in the cloud select: Microsoft cloud sandbox (out of scope in this post). Now other files are created in your ‘project folder’, these 2 are the most important: launch.json and settings.json
Locate and click launch.json in the explorer (left pane). You now see the contents of this file. Our default BC installation uses Windows authentication so change the launch.json:

"authentication": "UserPassword", 

to

"authentication": "Windows",

and save the file.

Now download the symbols. Press [F1] and type the command: AL: Download Symbols and press [Enter]. I received an error

Error: Could not connect to the server. Please verify that:1. The server is started.2. The development endpoint is enabled (DeveloperServicesEnabled server setting).3. The service name matches the one specified in the URL.4. The port number matches the one specified in the URL (DeveloperServicesPort server setting).5. The protocol matches the one specified in the URL (DeveloperServicesSSLEnabled server setting), and that a trusted certificate is used in case of an SSL connection.

I enabled DeveloperServices on the service, saved the change and restarted the service and now I was able to download the symbols:

Enable Developer Service Endpoint in the Busines Central Administration Tool

If you couldn’t download the symbols don’t proceed. All further steps will fail until you resolve the issue. If the symbol download was succesfull you should see a message in the output pane:

Open HelloWorld.al in the VS Code explorer (Left Pane) and change the message to something else.
Publish the file (which in fact is a page extension). Press [F5]. In my scenario the publish failed due to an error:

Error: Could not open the specified startup page. Please check that the server configuration key PublicWebBaseUrl has been properly set.

So after checking this key I filled in the WebBaseUrl saved it and restarted the BC service:

Tip: it’s also possible to change this setting by using PowerShell.

Web Client Base URL setting in the Administration Tool

The publish still errored. So I closed VS Code and published it again. It now executed without any problems and our first extension is published:

You will see this message (extension) when you open the customer card

This was originally posted here.

Comments

*This post is locked for comments