Dynamics 365 Business Central Development Quick Start Guide
eBook - ePub

Dynamics 365 Business Central Development Quick Start Guide

Modern development techniques for Dynamics 365 Business Central

  1. 224 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Dynamics 365 Business Central Development Quick Start Guide

Modern development techniques for Dynamics 365 Business Central

About this book

Understanding the new Microsoft Extension model for development

Key Features

  • Develop solutions for Dynamics 365 Business Central
  • Orient yourself with the new Microsoft Extension model for development
  • Learn modern ways to develop with Dynamics 365 Business Central

Book Description

Microsoft Dynamics 365 Business Central is the new SaaS ERP proposition from Microsoft. This latest version has many exciting features guaranteed to make your life easier. This book is an ideal guide to Dynamics 365 Business Central and will help you get started with implementing and designing solutions for real-world scenarios.

This book will take you through the fundamental topics for implementing solutions based on Dynamics 365 Business Central (on-premise and SaaS). We'll see the core topics of the new development model (based on extensions) and we'll see how to create applications with the new Microsoft ERP proposition.

The book begins by explaining the basics of Dynamics 365 Business Central and the Microsoft ERP proposition. We will then cover topics such as extensions, the new modern development model of Visual studio code, sandboxes, Docker, and many others.

By the end of the book, you will have learned how to debug and compile extensions and to deploy them to the cloud and on-premise.You will also have learned how to create serverless business processes for Microsoft Dynamics 365 Business Central.

What you will learn

  • Develop solutions for Dynamics 365 Business Central
  • Create a sandbox for extensions development (local or on cloud)
  • Use Docker with Dynamics 365 Business Central
  • Create extensions for Dynamics 365 Business Central
  • Handle dependencies, translations and reporting
  • Deploy extensions on-premise and to the cloud
  • Create serverless processes with Dynamics 365 Business Central
  • Understand source code management for AL

Who this book is for

This book is for Microsoft Dynamics 365 Business Central solution developers and architects that needs to implement solutions based on the Microsoft's ERP (on-premise and SaaS).

Trusted by 375,005 students

Access to over 1.5 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Year
2018
Print ISBN
9781789347463
Edition
1
eBook ISBN
9781789348088

Developing an Extension with AL and VS Code

In Chapter 4, Creating Your Development Sandbox, we saw how to create a Microsoft Dynamics 365 Business Central sandbox environment for developing and testing purposes, and we saw all the available sandbox types you can create (online, hosted on Azure, and hosted locally).
In this chapter, we'll develop a complete extension for Microsoft Dynamics 365 Business Central by using the new modern development environment, Visual Studio Code.
Here, you will learn the following:
  • How to create new tables and extend existing ones
  • How to create new pages and extend existing ones
  • How to create custom business logic and how to use events in AL
  • How to create a custom report
  • Different tips and tricks for developing extensions with AL
  • Handling dependencies between extensions
  • Handling translations and multi-language capabilities

The business case

As a business case for our brand new extension for Microsoft Dynamics 365 Business Central, we need to handle the categorization of customers and we need to handle some sales business processes according to the customer's category.
We need to define categories for customers and we need to have a field on the customer card to associate a category with a customer. We need a way to define a default category and assign this default category to a particular customer or to all customers.
Then, for each customer category, we can define whether this category has the possibility to receive gifts when the customer that belongs to that category makes a sales order for an item. For that, we need to have a table set up where for each customer category, we can associate an item with a minimum quantity to order and the associated quantity for a free gift. For example, we need to setup a record such as this:
Customer category Item no. Minimum quantity on order Gift quantity
GOLD ITEM001 5 1
Here, if a customer that belongs to the GOLD category makes a sales order with ITEM001 with quantity >= 5, they will receive a gift with ITEM001 with a quantity of 1.
When entering the sales order line in Microsoft Dynamics 365 Business Central, if there's a match between the customer category, the item on the sales line, and the minimum quantity, the system must add a new line with the gift and the 100% discount automatically.
This is only a sample to demonstrate different features when developing an extension. We could certainly improve the controls and the business logic but that is outside our scope here.
By analyzing the business case, we can see that we need to:
  • Add two new tables to Microsoft Dynamics 365 Business Central (Customer Category and Free Gifts)
  • Modify existing tables (the Customer table)
  • Create new pages (the UI for our custom objects)
  • Modify existing pages (such as Customer Card)
  • Create new business logic (custom codeunits)
After opening Visual Studio Code (with the AL language module for Microsoft Dynamics 365 Business Central enabled) we can start a new AL project (AL:Go! in Command Palette). In launch.json, we can enter the connection details into our sandbox environment (as shown in Chapter 4, Creating Your Development Sandbox) and with AL: Download Symbols we can download the symbols.
Now, we're ready to develop our extension for Microsoft Dynamics 365 Business Central.

Developing the extension

We've structured our project folder as follows:
We have an Src folder and under that we have a subfolder for every functionality and then for object type.
The name of each AL file is created using Microsoft's naming guidelines:
  • Each file name must start with the corresponding type and ID, followed by a dot for full objects or a dash for extensions:
    • Full objects: <Type><Id>.<ObjectName>.al, such as Tab.50100.MyTable.al
    • Extensions: <Type><BaseId>-Ext<ObjectId>.<ObjectName>.al : page 50100 MyPage extends Customer Card such as Pag21-Ext50100.MyPage.al
  • It is required to use a prefix or suffix for the name property of the fields in your extension. You would then use the Caption/CaptionML values for what to display to the user. This avoids the collision of fields between extensions:
    • A tag must be at least three characters
    • The object/field name must start or end with the tag
    • If a conflict arises, the one who registered the tag always wins
    • Example: SalesPersonCode.SDM
Our app.json file (extension manifest file) is defined as follows:

Creating the new tables

As our first step, we need to create the two new tables that we need to add to Dynamics 365 Business Central in order to satisfy our requirements.
To create a new table, we add a file under the Src\CustomerCategory\table folder called Tab50100.CustomerCategory.al, and in this file we create the definition for the Customer Category table by using the ttable AL snippet:
The snippet adds a skeleton to create a table. Here, you need to set the object ID, the object name, and define the fields of your tables and keys.
Our Customer Category table will be defined as follows:
Here is the complete AL code:
table 50100 "Customer Category"
{
DrillDownPageId = "Customer Category Li...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Packt Upsell
  4. Contributors
  5. Preface
  6. Microsoft Dynamics 365 Business Central Overview
  7. The New Extension Model
  8. Modern Development Environment Overview
  9. Creating Your Development Sandbox
  10. Developing an Extension with AL and VS Code
  11. Deploying Extensions
  12. Integration and Serverless Processing
  13. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.5M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1.5 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Dynamics 365 Business Central Development Quick Start Guide by Stefano Demiliani, Duilio Tacconi in PDF and/or ePUB format, as well as other popular books in Computer Science & Entreprise Applications. We have over 1.5 million books available in our catalogue for you to explore.