Microsoft Dynamics 365 Business Central Cookbook - Michael Glue - E-Book

Microsoft Dynamics 365 Business Central Cookbook E-Book

Michael Glue

0,0
40,81 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Gain useful insights to help you efficiently build, test, and migrate customized solutions on Business Central cloud and on-premise platforms




Key Features



  • Explore enhanced functionalities and development best practices in Business Central


  • Develop powerful Business Central projects using the AL language


  • Master the new Business Central with easy-to-follow recipes



Book Description



Microsoft Dynamics 365 Business Central is a complete business management solution that can help you streamline business processes, connect individual departments in your company, and enhance customer interactions.






Ok. That first part was really professional sounding, right? Now, let's get into what this cookbook is going to do for you: put simply, it's going to help you get things done. This book will help you get to grips with the latest development features and tools for building applications using Business Central. You'll find recipes that will guide you in developing and testing applications that can be deployed to the cloud or on-premises. For the old-schoolers out there, you'll also learn how to take your existing Dynamics NAV customizations and move them to the new AL language platform.






Also, if you haven't figured it out already, we're going to be using very normal language throughout the book to keep things light. After all, developing applications is fun, so why not have fun learning as well!




What you will learn



  • Build and deploy Business Central applications


  • Use the cloud or local sandbox for application development


  • Customize and extend your base Business Central application


  • Create external applications that connect to Business Central


  • Create automated tests and debug your applications


  • Connect to external web services from Business Central



Who this book is for



This book is for Dynamics developers and administrators who want to become efficient in developing and deploying applications in Business Central. Basic knowledge and understanding of Dynamics application development and administration is assumed.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 367

Veröffentlichungsjahr: 2019

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Microsoft Dynamics 365 Business Central Cookbook

 

 

 

 

 

Effective recipes for developing and deploying applications with Dynamics 365 Business Central

 

 

 

 

 

 

 

 

 

Michael Glue

 

 

 

 

 

 

 

 

 

 

 

 

BIRMINGHAM - MUMBAI

Microsoft Dynamics 365 Business Central Cookbook

Copyright © 2019 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

 

Commissioning Editor:Richa TripathiAcquisition Editor:Shriram ShekharContent Development Editor:Divya VijayanSenior Editor: Afshaan KhanTechnical Editor: Ketan KambleCopy Editor: Safis EditingProject Coordinator:Prajakta NaikProofreader: Safis EditingIndexer:Tejal Daruwale SoniProduction Designer:Nilesh Mohite

First published: August 2019

Production reference: 1080819

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-78995-854-6

www.packtpub.com

 
 
 
 
 
 
 
 
  
To my wife, Jennifer, for having so much patience waiting for me to finish coding well into the evening. You are the absolute best!
To my kids, Emily, Dylan, Jenna, and Ethan, for simply being amazing and always giving me that reason to step away from the computer.
 

Packt.com

Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Fully searchable for easy access to vital information

Copy and paste, print, and bookmark content

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and, as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. 

Contributors

About the author

Michael Glue began his Dynamics journey in June 2001, when he became a certified Dynamics NAV developer. Starting with building custom solutions, he later became a product architect, where he focused solely on building repeatable vertical products. Today, Michael works with a talented research and development team as they continue to push their products forward on the Business Central platform. In 2018, Michael was given his first MVP award in Business Applications. Along with his wife, Jennifer, they have four amazing kids and four very active dogs. From coaching his daughters' baseball team, to playing video games with his boys, to watching a good movie with his wife, not a day goes by that is devoid of excitement. You can follow Michael on Twitter (@navbitsbytes).

About the reviewer

Quenneth Surban is an enthusiastic solutions developer in the Philippines. Kicking off his career in 2016, he partnered with Microsoft to build innovative solutions to help businesses simplify their day-to-day operations. Since then, he has become a certified Microsoft Technology Associate on Software Development. More recently, he moved to become a Microsoft Certified Professional on Programming in C#, and also had the opportunity to work with several organizations to build solutions in Office 365, Dynamics 365, and Microsoft Azure. Today, he continues to design and develop solutions whilst closely working with customers to help them add value with these solutions.

 

 

 

 

 

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Title Page

Copyright and Credits

Microsoft Dynamics 365 Business Central Cookbook

Dedication

About Packt

Why subscribe?

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files 

Code in Action

Download the color images

Conventions used

Sections

Getting ready

How to do it…

How it works…

There's more…

See also

Get in touch

Reviews

Let's Get the Basics out of the Way

Technical requirements

Setting up your development sandbox

Getting ready

How to do it...

Option 1 – Sandbox hosted in Business Central

Option 2 – Azure-hosted sandbox

Option 3 – Sandbox in a local container

Option 4 – Local sandbox using installation media

How it works...

See also

Creating a new AL project

Getting ready

How to do it...

How it works...

There's more...

Creating basic entities 

Getting ready

How to do it...

How it works...

See also

Creating new business logic

Getting ready

How to do it...

How it works...

See also

Classifying data

Getting ready

How to do it...

How it works...

There's more...

See also

User permissions

Getting ready

How to do it...

How it works...

There's more...

See also

Creating new reports

Getting ready

How to do it...

How it works...

There's more...

See also

Adding help links

Getting ready

How to do it...

How it works...

See also

Customizing What's Already There

Technical requirements

Adding fields to base application tables

Getting ready

How to do it...

How it works...

See also

Modifying the base application interface

Getting ready

How to do it...

How it works...

See also

Modifying the base application business logic

Getting ready

How to do it...

How it works...

See also

Using In-client Designer

Getting ready

How to do it...

How it works...

See also

Using Event Recorder

Getting ready

How to do it...

How it works...

See also

Replacing base application reports

Getting ready

How to do it...

How it works...

See also

Adding new profiles and role centers

Getting ready

How to do it...

How it works...

See also

Adding filter tokens

Getting ready

How to do it...

How it works...

See also

Adding application areas

Getting ready

How to do it...

How it works...

There's more...

See also

Let's Go Beyond

Technical requirements

Control add-ins

Getting ready

How to do it...

How it works...

See also

Dependencies

Getting ready

How to do it...

How it works...

There's more...

Translations

Getting ready

How to do it...

How it works...

There's more...

See also

Adding new manual setups

Getting ready

How to do it...

How it works...

There's more...

Assisted Setup wizards

Getting ready

How to do it...

How it works...

Isolated storage

Getting ready

How to do it...

How it works...

See also

Notifications

Getting ready

How to do it...

How it works...

See also

Using the task scheduler

Getting ready

How to do it...

How it works...

See also

.NET interoperability

Getting ready

How to do it...

How it works...

See also

Implementing telemetry events

Getting ready

How to do it...

How it works...

There's more...

See also

Testing and Debugging - You Just Gotta Do It

Technical requirements

Introducing the debugger

Getting ready

How to do it...

How it works...

There's more...

See also

Debugging SQL

Getting ready

How to do it...

How it works...

See also

The Automated Testing Toolkit

Getting ready

How to do it...

How it works...

See also

Creating a test application

Getting ready

How to do it...

How it works...

There's more...

Creating automated tests

Getting ready

How to do it...

How it works...

There's more...

See also

Testing the UI

Getting ready

How to do it...

How it works...

See also

UI handlers

Getting ready

How to do it...

How it works...

See also

Creating a test library

Getting ready

How to do it...

How it works...

See also

Old School, Meet New School

Technical requirements

Converting CAL to AL

Getting ready

How to do it...

How it works...

See also

There's more...

Post-conversion cleanup

Getting ready

How to do it...

How it works...

Upgrading data from CAL objects

Getting ready

How to do it...

How it works...

There's more...

Making Your App Extensible

Technical requirements

Publishing events in your code

Getting ready

How to do it...

How it works...

See also

Enums

Getting ready

How to do it...

How it works...

See also

The Discovery design pattern

Getting ready

How to do it...

How it works...

See also

The Handled design pattern

Getting ready

How to do it...

How it works...

See also

The Variant Façade design pattern

Getting ready

How to do it...

How it works...

See also

The Argument Table design pattern

Getting ready

How to do it...

How it works...

See also

Business Central for All

Technical requirements

Consuming external web services

Getting ready

How to do it...

How it works...

See also

Publishing your own web service

Getting ready

How to do it...

How it works...

See also

Enabling basic authentication

Getting ready

How to do it...

How it works...

There's more...

See also

The Business Central API – exploring with Postman

Getting ready

How to do it...

How it works...

There's more...

See also

The Business Central API – retrieving data

Getting ready

How to do it...

How it works...

There's more...

See also

The Business Central API – creating data

Getting ready

How to do it...

How it works...

There's more...

See also

The Business Central API – publishing a custom endpoint

Getting ready

How to do it...

How it works...

See also

Power Platform – using Microsoft Power BI

Getting ready

How to do it...

How it works...

There's more...

See also

Power Platform – using Microsoft Flow

Getting ready

How to do it...

How it works...

There's more...

See also

Power Platform – using Microsoft PowerApps

Getting ready

How to do it...

How it works...

There's more...

See also

Consuming Azure Functions

Getting ready

How to do it...

How it works...

See also

DevOps - Don't Live without It

Technical requirements

Creating an Azure DevOps project

Getting ready

How to do it...

How it works...

See also

Creating a code repository

Getting ready

How to do it...

How it works...

There's more...

See also

Connecting an AL project to Azure DevOps

Getting ready

How to do it...

How it works...

There's more...

See also

Installing a pipeline agent

Getting ready

How to do it...

How it works...

See also

Creating a build pipeline

Getting ready

How to do it...

How it works...

See also

Creating a release pipeline

Getting ready

How to do it...

How it works...

See also

Enabling branch policies

Getting ready

How to do it...

How it works...

There's more...

See also

Time to Share Your Application!

Technical requirements

Developing for multiple platforms

Getting ready

How to do it...

How it works...

See also

Protecting your Intellectual Property

Getting ready

How to do it...

How it works...

There's more...

See also

Signing your application

Getting ready

How to do it...

How it works...

There's more...

See also

Installation logic

Getting ready

How to do it...

How it works...

See also

Upgrade logic

Getting ready

How to do it...

How it works...

See also

Installing applications with PowerShell

Getting ready

How to do it...

How it works...

See also

Upgrading applications with PowerShell

Getting ready

How to do it...

How it works...

See also

Deploying a tenant customization

Getting ready

How to do it...

How it works...

See also

Other Books You May Enjoy

Leave a review - let other readers know what you think

Preface

Microsoft Dynamics 365 Business Central is a complete business management application. It can be used to streamline business processes in your company, connect individual departments across the company, and enhance customer interactions.

OK, that first part was really professional-sounding, right? Now, let's get into what this cookbook is going to do for you, and, quite simply, it's going to help you get things done. This book will help you get familiar with the latest development features and tools for building applications for Business Central. You'll find recipes that will help you build and test applications that can be deployed to the cloud, or on-premises. For the old-schoolers out there, you'll also learn how to take your existing Dynamics NAV customizations and move them to the new AL language platform.

Also, if you haven't figured it out already, we're going to be using very normal language here. We're trying to keep things light. After all, developing applications is fun, so why not have fun while learning to do it as well?!

Who this book is for

This book is for Dynamics developers and administrators who want to become efficient in developing and deploying applications in Business Central.

A basic level of knowledge and understanding of the AL programming language, along with an understanding of Dynamics application development and administration, is assumed.

What this book covers

Chapter 1, Let's Get the Basics out of the Way, explains how to set up an AL development sandbox, either locally or online, and then goes through basic topics that will typically be a part of all Business Central applications that you create.

Chapter 2, Customizing What's Already There, explains how you can customize the base Business Central application.

Chapter 3, Let's Go Beyond, explains topics that are not necessarily going to be implemented in every application, but are extremely powerful tools to be aware of for when the need arises.

Chapter 4, Testing and Debugging - You Just Gotta Do It, explains how to create automated tests for your Business Central application, and how you can use the debugger to track down issues.

Chapter 5, Old School, Meet New School, explains how to convert Dynamics NAV solutions to Business Central applications.

Chapter 6, Making Your App Extensible, explains things you can do in order to give other developers the ability to extend and customize your application.

Chapter 7, Business Central for All, explains the things that you can do in your Business Central application to connect a Business Central system to other external services and applications.

Chapter 8, DevOps - Don't Live without It, explains how to use Azure DevOps to track source code changes, and to automate the building and deploying of your application.

Chapter 9, Time to Share Your Application!, explains how to deliver your application to customers, both on-premises and online.

To get the most out of this book

Although this book starts with some entry-level topics, it is expected that you have a general understanding of how to program using the AL programming language. If you plan on using a local, container-based development sandbox, you will need to have a basic level understanding of Docker and PowerShell.

Download the example code files 

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

Log in or register at

 

www.packt.com

.

Select the

 

SUPPORT

 

tab.

Click on

 

Code Downloads & Errata

.

Enter the name of the book in the

 

Search

 

box and follow the on screen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR/7-Zip for Windows

Zipeg/iZip/UnRarX for Mac

7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Microsoft-Dynamics-365-Business-Central-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in Action

Visit the following link to see the code being executed:

http://bit.ly/2YUg1tI

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781789958546_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "We can do that by adding code to the OnInsert() trigger of the table so that our logic executes every time a record is inserted."

A block of code is set as follows:

"startupObjectId": 50101"startupObjectType": "Page"

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Your web browser will open and, once you log in, you will be presented with your new Television Show List page."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There's more..., and See also).

To give clear instructions on how to complete a recipe, use these sections as follows:

Getting ready

This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make you more knowledgeable of it.

See also

This section provides helpful links to other useful information for the recipe.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

Let's Get the Basics out of the Way

Microsoft Dynamics 365 Business Central is a complete business application management system. With it comes an exciting new development platform and tools. Using AL, the primary development language, and Visual Studio Code, the primary development tool, you can create incredibly rich and feature-packed Business Central applications to fit the needs of virtually any customer.

In this chapter, we're going to go over the basics (yes, exactly like the title says!). Some of the recipes in this chapter are very simple, and you might wonder what the point of them is, but don't discount them. There is a reason behind each one, and I'll explain them along the way.

We will start this chapter with a recipe for setting up your development sandbox. After all, we can't build any applications without a place to test them! Once we have our sandbox in place, we will install and configure Visual Studio Code in order to connect it to the sandbox. We'll then move on through a set of recipes that will show you some of the basic components that almost every application you build will have.

In this chapter, we will cover the following recipes:

Setting up your development sandbox

Creating a new AL project

Creating basic entities

Creating new business logic

Classifying data

User permissions

Creating new reports

Adding help links

Technical requirements

In order to complete the recipes in this chapter (and this book, for that matter!), you need to install Visual Studio Code on your machine. You will use this to code your AL applications, but you can also use it for a myriad of other programming languages and scripts. You can read and obtain Visual Studio Code at https://code.visualstudio.com/.

If you plan on using a Docker container on your local machine, then you'll also need to install Docker. You're going to want to make sure you install the right edition, based on your OS:

Windows 10: 

https://store.docker.com/editions/community/docker-ce-desktop-windows

Windows Server: 

https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-server

If you have a Business Central license file, you should upload it somewhere that you can access it using a secure URL. For example, you can upload it to either an Azure Storage or Dropbox account. You must be able to get a secure URL for direct download.

Code samples and scripts are available on GitHub. Each of the recipes in this chapter builds on the previous recipe, so you can always download the previous recipe's code to get a quick jump on things if you don't want to work through them all in order. You can download everything you need from https://github.com/PacktPublishing/Microsoft-Dynamics-365-Business-Central-Cookbook/tree/master/ch1.

For the reporting recipe, you'll need to have Microsoft Report Builder installed. You can download that from Microsoft Download Center at https://go.microsoft.com/fwlink/?LinkID=734968.

Setting up your development sandbox

Well, we're kicking things off with a bang! Our first recipe is probably the longest recipe in this book, but that's because you have choices when it comes to setting up your development sandbox. Will you use a sandbox hosted in Business Central or will you set up your sandbox on a machine? Will that machine be hosted in Azure or on your local machine? Will you use a container or not? The choice is yours, and we'll go through each process in this recipe. By the end of this recipe, you will have a place to do all of your AL coding!

Getting ready

Depending on how you want to set up your development sandbox, you may need to do a few different things to prepare:

Sign up for or get access to a Business Central subscription

Sign up for or get access to an Azure subscription for which you can create virtual machines

Install Docker

Obtain the latest Business Central installation media

How to do it...

We have four different choices here. If you're super savvy, then by all means, try them all out, but really, you only need to do the one that fits you best.

Option 1 – Sandbox hosted in Business Central

If you want to set up your development sandbox to be hosted in Business Central—which, by the way, is the simplest of all the options—perform the following steps:

Sign up for a Microsoft Dynamics 365 Business Central sandbox at 

https://aka.ms/getsandboxforbusinesscentral

.

When you sign up for your sandbox, you cannot use a personal email address. You must use either a work or school account.

Install the AL Language extension from the Visual Studio Code Marketplace at 

https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al

:

There are just two steps to getting your sandbox! Once you go through the signup process, you'll be logged into your sandbox and will be greeted with a message similar to the following:

Option 2 – Azure-hosted sandbox

If you want to use a container hosted on a virtual machine in Azure, perform the following steps:

If you have not already done so, you can sign up for an Azure subscription at

https://azure.microsoft.com

and start with a free account.

Now that we have an Azure subscription, we need to create a virtual machine within that subscription. This virtual machine will host a Business Central environment inside a Docker container. To make this easy, there is an

Azure Resource Manager

(

ARM

) template available for you to use.

You can access the template at https://aka.ms/getbc. Make sure to use your Azure subscription login credentials.The template contains a lot of options, but for our purposes, we're going to focus on just a few of them. Once you're familiar with the process, take a look at the other options and do things such as connecting your sandbox to an Office 365 account! See the options in the following table:

Option

Comment

Resource Group

Select

Create new

to create a new resource group for this virtual machine. You can name it whatever you like.

Location

Choose the region closest to where you are connecting from. Selecting a region on the other side of the world from you will impact connection performance.

VM Name

Give your machine a name – any name you want! Azure will make sure that the name you choose is acceptable.

Time zone Id

Select the time zone you wish to work in.

Accept EULA

You must accept the

End User License Agreement

(

EULA

) by selecting

Yes

 for this option. The EULA can be found at 

https://go.microsoft.com/fwlink/?linkid=861843

.

Remote Desktop Access

Use this option to configure whether you are able to use

Remote Desktop Protocol

(

RDP

) to remotely log in to the virtual machine. Set this to an asterisk (*) if you want to connect to this machine from any machine.

VM Admin username

You can leave this as the default value, 

vmadmin

, or change it to one that suits you better. This login will be used to remote connect (via RDP) to the machine. This login is configured as the local administrator for the virtual machine.

BC Admin username

You can leave this as the default value,

admin

, or change it to one that suits you better. You will use this login to launch the Business Central Web Client. This user is configured as a super user in the Business Central system.

Admin Password

Set this to any password you want. This password applies to both the

virtual machine

and BC admin logins. Azure will ensure that the password you enter is strong enough.

BC Docker Image

Here, you can configure the Docker image you wish to use. Set this option to 

microsoft/bcsandbox:xx

, where

:xx

represents the country localization you want (for example,

microsoft/bcsandbox:ca

for Canada). For the list of countries available, see 

https://hub.docker.com/_/microsoft-businesscentral-sandbox

.

License File URL

If you uploaded a Business Central license to an online storage account, specify the secure URL to the file in this option. You can leave this option blank if you want to use a demo license.

You can get more information on each option in the template by using the '!' icon onscreen, which is directly to the right of each option name.

Once you have filled in the ARM template, accept the terms and conditions at the bottom of the screen and then click the

Purchase

button.

Now, you can just sit back and relax, and if your template was configured properly, your virtual machine will be created. Go grab a coffee and check back later.

Make sure you wait at least one hour before logging into the virtual machine. Even after it is successfully created, the machine will go through a series of configurations to create and set up the container.

To test the connection to your Azure virtual machine, you need to remotely connect to the machine to get some information from it. You need to use the Azure web portal (

https://portal.azure.com

) to find the address of your virtual machine:

In the Azure web portal, click on

Virtual Machines

 in the navigation pane on the left:

If you do not see

Virtual Machines

, press

All Services

and search for

Virtual Machines

 to select it.

Select the name of the virtual machine that you just created.

Look for the

DNS Name

 and take note of the address listed below it:

For example, 

myvirtualmachine.canadaeast.cloudapp.azure.com

We can monitor the status of the virtual machine configuration by navigating to the virtual machine landing page:

In your web browser, navigate to the

DNS Name

 you noted previously.

Click the

View Installation Status

link. Here, you can see when the virtual machine configuration is complete and is ready to use for development.

Once the virtual machine has been fully configured, the landing page will look similar to this:

Now, we need to take note of a few pieces of information, for later.

At the bottom of the landing page is a section named Access the Dynamics 365 Business Central Sandbox Environment using Visual Studio Code. In this section, take note of the following values:

You can also download a remote connection file from the landing page in the event that you want to connect to and work directly within the server.

Before we close the landing page, we need to install the security certificate so that we can connect to the sandbox:

On the landing page, click the

Download Certificate

link and save the file to your local machine.

Depending on which web browser you are using, click either the

Windows (Edge/IE/Chrome)

or the

Windows (Firefox)

link and follow the onscreen instructions to install the certificate.

Let's check to make sure we can connect to the Business Central Web Client:

Close your web browser and navigate to the landing page for your virtual machine.

Click the Web Client link on the right-hand side of the page.

You should now be looking at the Business Central login page:

If you get an error about an unsecured connection, try restarting your web browser and/or reinstalling the security certificate. 

Install the 

AL Language

 

extension from the

 

Visual Studio Code Marketplace

https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al

.

Option 4 – Local sandbox using installation media

If you want to install Business Central onto your local machine using the installation media, you can do that by following these steps:

From the installation media, run

setup.exe

.

You must accept the licensing terms. Once you do that, click

Advanced Installation Options

.

Here, you can choose between two setup options:

Install Demo

: This installs a pre-configuration selection of components without manual intervention.

Choose an installation option

: This allows you to choose which components to install and allows you to select some additional configuration options.

Click the

Choose an installation

option so that we can select the components that we need to complete the recipes in this book. 

Click

Customize...

under the

Developer

option.

Make sure that the following components are set to

Run from My Computer

:

AL Development Environment

Server Administration Tool

Server

SQL Server Database Components

SQL Server Database Components | Demo Database

Web Server Components

Dynamics NAV Client | Development Environment (C/SIDE)

Here is a screenshot for your reference:

Click

Next

and you will see some additional installation parameters. For the purposes of the recipes in this book, you do not need to change anything here.

If you already have a compatible version of Microsoft SQL Server installed on your local machine, you can change the SQL Server and SQL Server Instance parameters to the corresponding ones so that the Business Central installation will use that instead of installing a new instance.

Click

Apply

to perform the installation.

If the installation cannot find a compatible version of Microsoft SQL Server, then you will be notified that it will install a new instance. At the time of writing, Microsoft SQL Server 2016 Express is the version that will be installed.

Once the installation has completed, click 

Close

 to close the installation wizard.

You

 

can

 

verify

 

the

 

installation

 

by

 

opening

 

the

 

Business

 

Central

 

Web

 

Client

 

from

 

the

 

following

 

URL:

 

http://localhost:8080/BC130

.

Install the 

AL Language

 

extension from the

 

Visual Studio Code Marketplace

 at 

https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al

.

How it works...

As you can see, you have a variety of ways you can configure your development sandbox. Personal preference may lead you to choose one way or another, but there are a few things to keep in mind when selecting which configuration to use:

Do you need offline access to your development sandbox?

If so, then an Azure-hosted system might not be the right choice for you.

Do you need to build for the current Business Central SaaS version?

 If so,

then y

ou might want to consider setting up your development sandbox to be hosted in Business Central so that it is always on the current release.

Do you need to make sure your application will work on a future Business Central release?

If so, you will want to take part in Microsoft's

Ready to Go

 (

http://aka.ms/readytogo

) program so that you can gain access to future releases made available via Docker images.

Do you need to have multiple versions of Business Central on your local machine?

If so, there's no easier way than using Docker containers to do that!

Each of the processes resulted in the same thing: a development system that will be used to build and test new Business Central applications. Whether it is hosted or not, or a container or local installation, the end result is the same: a development sandbox that you will build and publish your Business Central applications to.

See also

For more information on setting up development sandboxes, you can refer to the Getting Started With AL article on the Microsoft Docs website at https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-get-started.

Creating a new AL project

In this recipe, we are going to create a quick and easy sample application. Of course, you can start from a blank slate, but we'll start with the built-in Hello World application. It's the easiest way to get your AL development up and running.

Getting ready

You need to have your development sandbox set up and know the address so that you can connect and log in to it. You should have also already installed the AL Language extension in Visual Studio Code. You're definitely going to need that!

How to do it...

Open Visual Studio Code.

Press

Ctrl

+

Shift

+

P

to open the

Command Palette

and type or select

AL:Go!

to create a sample

Hello World

 application.

When prompted, enter the path to where the new project will be stored. You can leave it as the default path or type in a new one. Press

Enter

to confirm the path.

When prompted, you need to select the sandbox type based on what you are working with. You have two options:

Microsoft Cloud Sandbox

: Select this option if you are hosting your development sandbox in Business Central (Option 1 in the 

Setting up your development sandbox

 section). When you select this option, you will be prompted to log in with your Microsoft account. Use the account under which you created the Business Central sandbox.

Your own server

: Select this option if you chose to put your sandbox in an Azure virtual machine, or on your local machine using a container or the installation media (Options 2 - 4 in the 

Setting up your development sandbox

section). When you select this option, you will be prompted to log in. Press

Escape

to cancel the login.