Programming Microsoft Dynamics 365 Business Central - Marije Brummel - E-Book

Programming Microsoft Dynamics 365 Business Central E-Book

Marije Brummel

0,0
32,39 €

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

Business Central opens a world of endless possibilities for custom business logic and functionality through extensions and customizations. For beginners in the AL language, navigating the vast landscape can feel overwhelming. It’s challenging to know where to start and what’s essential to learn. This updated edition offers a concise and well-organized guide, featuring hands-on exercises to support a successful learning journey.
You’ll get to grips with the basics of Business Central and how to create your first Visual Studio Code project with the AL language. As you learn about the table data structure, simple and complex data types, relationships, validation, and data flow, you’ll be able to add and extend tables to your project. Progressively, you'll uncover the intricacies of user interfaces with pages, create advanced Excel report layouts, and harness the power of data queries. Immersing yourself in the AL language syntax, you’ll start with variables, methods, procedures, and statements. You'll explore advanced topics to create business logic such as FlowFields, filtering, CRUD methods, interactions between object types, and different API interfaces that can be created using the AL language.
By the end of this book, you’ll be equipped to build fully featured, robust extensions and custom capabilities for Business Central.

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

EPUB
MOBI

Seitenzahl: 578

Veröffentlichungsjahr: 2024

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.



Programming Microsoft Dynamics 365 Business Central

Build powerful, robust, and scalable extensions customized for your business requirements

Marije Brummel

Natalie Karolak

Christopher D. Studebaker

David Studebaker

Programming Microsoft Dynamics 365 Business Central

Copyright © 2024 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 authors, 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.

Group Product Manager: Aaron Tanna

Associate Publishing Product Manager: Uzma Sheerin

Senior Editor: Rounak Kulkarni

Technical Editor: Vidhisha Patidar

Copy Editor: Safis Editing

Book Project Manager: Prajakta Naik

Proofreader: Rounak Kulkarni

Indexer: Pratik Shirodkar

Production Designer: Aparna Bhagat

Business Development Executives: Saloni Garg

Cover picture credit: Elizabeth Studebaker

First edition: September 2007

Second edition: November 2009

Third edition: February 2013

Fourth edition: July 2015

Fifth edition: April 2017

Sixth edition: April 2019

Seventh edition: November 2024

Production reference: 1160924

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-80323-641-4

www.packtpub.com

To my father, David, whose authorship of the first editions of this book has been a guide to all that have come after, with many more to come.

– Christopher D. Studebaker

To the great Business Central community, which has always enriched me with both supportive and entertaining exchanges. May this book be the newcomers’ first step toward their membership of the community as well.

– Natalie Karolak

Contributors

About the authors

Marije Brummel is a coach, author, programmer, consultant, project manager, presenter, evangelist, and trainer. Marije has received the Microsoft MVP and the NAVUG All-Star awards, among several other awards. She has chaired the Microsoft Dynamics Credentialing committee and has authored official Microsoft Exam materials. She’s the go-to girl for performance troubleshooting and upgrade challenges. One of her biggest achievements was introducing Design Patterns into the Business Central community. Her books, blog articles, and YouTube videos have influenced almost everyone involved with Business Central. She is a mother of five, enjoys the outdoors with her dog, and loves spending time with her family.

Natalie Karolak works at COSMO CONSULT, a leading European provider of industry-specific business software and end-to-end IT solutions. As a product architect, she develops and maintains Business Central apps for Microsoft AppSource. Programming for NAV/BC partners since 2006, Natalie has always been passionate about knowledge gain and knowledge sharing. For her commitment to the German-speaking online community, she was presented with the MVP award from 2012 to 2016 and regained it in 2024. Today, she shares English-speaking news and information for AL programmers on X, and on her blog that is named after the title that the community gave her: The BC Docs Librarian.

Christopher D. Studebaker was a certified environmental consultant working with manufacturing facilities to meet national and state regulations before he started working with Business Central (then known as Navision) in 1999. After working on regulatory reporting, data analysis, project management, and subcontractor oversight, Chris has used those skills to sell, develop, and implement Business Central for more than 25 years. He has specialized in retail, manufacturing, job shop, and distribution implementations, mostly in high-user-count, high-data-volume applications. Chris serves as a technical consultant and trainer for customers and fellow Business Central professionals. He has a Bachelor of Science degree from Northern Illinois University and has done graduate work at Denmark Technical University.

David Studebaker has been designing and developing software since 1962 as a developer, consultant, manager, and business owner. In 1967, David co-authored the first general-purpose SPOOL system, an AT&T/IBM joint project. He has been a founding partner in several firms, most recently Studebaker Technology and Liberty Grove Software. David’s publications include a decade of technical reviews for ACM Computing Reviews and a number of articles on shop floor data collection. David originated the Packt series of books on programming Microsoft Dynamics Business Central (aka Dynamics NAV). He holds a BS in mechanical engineering from Purdue University and an MBA from the University of Chicago. He is a life member of the Association for Computing Machinery.

About the reviewer

Brad Prendergast is a seasoned professional with over 20 years of experience with Microsoft Dynamics 365 Business Central (formerly Navision) and holds an undergraduate and master’s degree in computer information systems. Over the years, Brad has worked on both sides of ERP implementations, providing him with a unique perspective as both a partner and an end user. His extensive experience includes architecting and developing solutions, with both process and technology, to increase efficiency. Brad is also an active member of the Business Central community, and co-host of the popular Dynamics Corner podcast, frequently sharing his insights and expertise online and at industry events and conferences. His passion for the application and the community is evident in his dedication to helping businesses achieve their goals through innovative ERP solutions.

Table of Contents

Preface

1

Introduction to Business Central

Technical requirements

Business Central – an ERP system

Financial management

Manufacturing

Supply chain management

Business intelligence and reporting

Relationship management

Human resource management

Project management

A developer’s overview of Business Central

Business Central applications

Business Central object types

The Visual Studio Code integrated development environment

Visual Studio Code icons

AL programming language

Business Central object elements

Business Central functional terminology

UI

Hands-on development in Business Central

Business Central development exercise scenario

Getting started with application design

Folder structure

Symbol files

Application tables

Pages

Creating a list page

Creating a card page

Creating some sample data

Creating a list report

Other Business Central object types

Extension data types

Codeunits

Queries

XMLports

Development backups and documentation

Summary

Questions

2

Tables

An overview of tables

Components of a table

Naming tables

Table numbering

Table properties

Table triggers

Keys

SumIndexFields

Nonclustered Columnstore Indexes

Field groups

Temporary tables

Enhancing our sample application

Creating and modifying tables

Assigning a table relation property

Assigning an InitValue property

Adding a few activity-tracking tables

New tables for our WDTU project

New list pages for our WDTU project

Keys, SumIndexFields, and table relations in our examples

Extending an original Business Central table

Functional table types

Extensible tables

Non-extensible tables

Summary

Questions

3

Data Types and Table Fields

Basic definitions

Table fields

Field definition

Field properties

Field triggers

Field events

Data structure examples

Data types

Simple data types

Complex data types

Data type usage

FieldClass property options

FieldClass – Normal

FieldClass – FlowField

FieldClass – FlowFilter

FlowField and FlowFilter properties for our application

Filtering

Experimenting with filters

Accessing filter controls

Summary

Questions

4

Pages – The Interactive Interface

Page design and structure overview

Business Central page structure

Types of pages

Document page type

ListPlus page type

Worksheet page type

ConfirmationDialog page

StandardDialog page

NavigatePage page type

Request page

Page parts

Power BI

Bound and unbound pages

Page names

Page components

Page triggers

Page properties

WDTU page enhancement – part 1

Page layout

Layout area section

Grouping controls

Layout example

WDTU page enhancement – part 2

Page actions

Action area section

Action group control

action control

Actions summary

Page searchability

UsageCategory property

ApplicationArea property

Advanced content

Client tools for page development

Page inspection

Designer

Learning more

Patterns and creative plagiarism

Experimenting on your own

Experimentation

Summary

Questions

5

Reports and Queries

Reports

What is a report?

Five Business Central report designers

Business Central report types

Report components – overview

Report structure

Report data flow

Report components – detail

Report properties

Report triggers

Request page properties

Request page triggers

Dataset analysis

Rendering layout

DataItem properties

DataItem triggers

Creating a report in Business Central

Learn by experimentation

Report building – phase 1

Report building – phase 2

Report building – phase 3

Extending an existing report with SQL Report Builder or Microsoft Office

Request page

Processing-only reports

Creative report plagiarism and patterns

Queries

Building a simple query

Query and query component properties

Summary

Questions

6

Introduction to AL

Understanding Visual Studio Code

Explorer

AL programming

AL naming conventions

Variables

Methods and procedures

AL syntax

Assignment and punctuation

Expressions

Frequently used AL methods

Conditional statements

Indenting code

Some simple coding modifications

Adding field validation to a table

Adding code to a report

Handling user-entered report options

Defining the request page

Testing the completed report

Summary

Questions

7

Intermediate AL

Validation methods

TestField method

FieldError method

Init method

Validate method

Date and time methods

Today, Time, and CurrentDateTime methods

WorkDate method

Date2DMY method

Date2DWY method

DMY2Date and DWY2Date methods

CalcDate method

Data conversion and formatting methods

Round method

Format method

Evaluate method

FlowField and SumIndexField methods

CalcFields method

SetAutoCalcFields method

CalcSums method

AL control statements

repeat-until

while-do

for-to or for-downto

case-else statement

Flow control methods

CRUD record methods

Next method

Insert method

Modify method

Delete method

ModifyAll method

DeleteAll method

Filtering methods

CopyFilter and CopyFilters methods

GetFilter and GetFilters methods

FilterGroup method

Mark method

ClearMarks method

MarkedOnly method

Reset method

Inter-object communication

Communicating through data

Communicating through procedure parameters

Communication via object calls

Enhancing the WDTU application

Modifying table fields

Creating the Playlist document page

Creating the Playlist subpage

Creating a procedure for our FactBox

Creating a FactBox page

Multi-language system

Translations in AL

Debugging in AL

Breakpoints

Running the AL debugger

Attach and debug next

Snapshot debugging and performance profiling

Troubleshoot directly from the web client

Summary

Questions

8

Extensibility beyond AL

Business Central web services (SOAP/OData)

Authentication

SOAP page

SOAP codeunits

XMLports

XMLport components

SOAP XMLport through WDTU codeunit

Publishing a web service

Executing web services externally

RESTful calls

OData page

API objects in AL

API pages for WDTU playlist

API query for WDTU listenership

Consuming external API

WDTU Tidal integration

WDTU API codeunit

Adding the new WDTU action

Business Central process flow

Initial setup and data preparation

Transaction entry

Testing and posting the Journal batch

Summary

Questions

Index

Other Books You May Enjoy

Preface

Welcome to the worldwide community of Microsoft Dynamics 365 Business Central developers! This is a collegial environment populated by AL developers who readily and generously share their knowledge. There are formal and informal organizations of Business Central-focused users, developers, and vendor firms scattered throughout the globe and active on the web. Our community continues to grow and prosper, and it now includes over 200,000 user companies worldwide.

The information in this book will help you shorten your learning curve on how to program for the Business Central Enterprise Resource Planning (ERP) system using the AL language, the Visual Studio Code development environment, and their capabilities. We hope you will enjoy working with Business Central as much as we have.

A brief history of Business Central

Each new version of Microsoft Dynamics 365 Business Central is the result of inspiration and hard work, along with some good fortune and expert technical investment over the last 30 years.

The beginning

Three college friends, Jesper Balser, Torben Wind, and Peter Bang, from Denmark Technical University (DTU) founded their computer software business in 1984 when they were in their early twenties; that business was PC Computing & Consulting (PC & C), and its first product was called PC Plus.

Single-user PC Plus

PC Plus was released in 1985 with the primary goal of ease of use. An early employee said its functional design was inspired by the combination of a manual ledger journal, an Epson FX-80 printer, and a Canon calculator. Incidentally, Peter Bang is the grandson of one of the founders of Bang & Olufsen, the manufacturer of home entertainment systems par excellence.

PC Plus was a PC DOS-based, single-user system. PC Plus’s design included the following features:

An interface resembling the use of documents and calculatorsOnline helpGood exception handlingMinimal reliance on computer resources

The PC Plus product was marketed through dealers in Denmark and Norway.

Multi-user Navigator

In 1987, PC & C released a new product, the multi-user Navigator, and a new corporate name, Navision. Navigator was quite a technological leap forward. It included the following features:

Client/server technologyA relational databaseTransaction-based processingVersion managementHigh-speed OLAP capabilities (SIFT technology)A screen painter toolA programmable report writer

In 1990, Navision was expanding its marketing and dealer recruitment efforts into Germany, Spain, and the United Kingdom. Also, in 1990, a third version of Navigator was released. Navigator V3 was still a character-based system, albeit a very sophisticated one. If you had the opportunity to study Navigator V3.x, you would instantly recognize the roots of today’s Business Central product. By V3, the product included the following features:

A design based on object-oriented conceptsIntegrated 4GL Table, Form, and Report Design tools (the IDE)Structured exception handlingBuilt-in resource managementThe original programming language that became C/AL, which later changed to ALFunction librariesThe concept of regional or country-based localization

When Navigator V3.5 was released, it also included support for multiple platforms and multiple databases. Navigator V3.5 would run on both Unix and Windows NT networks. It supported Oracle and Informix databases, as well as those developed in-house.

At about this time, several major strategic efforts were initiated. On the technical side, the decision was made to develop a GUI-based product. The first prototype of Navision Financials (for Windows) was shown in 1992. At about the same time, a relationship was established that would take Navision into distribution in the United States. The initial release in the US in 1995 was V3.5 of the character-based product, rechristened Avista for US distribution.

Navision Financials for Windows

In 1995, Navision Financials V1.0 for Microsoft Windows was released. This product had many (but not all) of the features of Navigator V3.5. It was designed for complete look-and-feel compatibility with Windows 95. There was an effort to provide the same ease of use and flexibility of development in Microsoft Access. The new Navision Financials was very compatible with Microsoft Office and was thus sold as “being familiar to any Office user.” Like any V1.0 product, it was quickly followed by a much-improved V1.1.

In the next few years, Navision continued to be improved and enhanced. Major new functionalities, such as the following, were added:

Customer Relation Management (CRM)Manufacturing (ERP)Advanced distribution (including Warehouse Management)

Various Microsoft certifications were obtained, providing muscle to the marketing efforts. Geographic and dealer-based expansion continued apace. By 2000, according to the Navision Annual Report of that year, the product was represented by nearly 1,000 dealers (Navision Solution Centers) in 24 countries and used by 41,000 customers, located in 108 countries.

Growth and mergers

In 2000, Navision Software A/S and its primary Danish competitor, Damgaard A/S, merged. Product development and new releases continued for the primary products of both original firms (Navision and Axapta). In 2002, the now much larger Navision Software, with all of its products (Navision, Axapta, the smaller, older C5, and XAL) was purchased by Microsoft, becoming part of the Microsoft Business Systems division, along with the previously purchased Great Plains Software business and its several product lines. The Navision and Great Plains products all received a common rebranding to become the Dynamics product line. Navision was renamed Dynamics NAV and, later, Business Central.

As early as 2003, research began with the Dynamics NAV development team, planning moves to further enhance NAV and take advantage of various parts of the Microsoft product line. Goals were defined to increase integration with products such as Microsoft Office and Microsoft Outlook. Goals were also set to leverage the functional capabilities of Visual Studio Code and SQL Server, among others. Throughout this, there was a determination not to lose the strength and flexibility of the base product.

NAV 2009 was released in late 2008, NAV 2013 in late 2012, followed by NAV 2015 in late 2014. NAV 2017 was released in October 2016. The biggest hurdles to the new technologies have been cleared. A new user interface, the Role Tailored Client, was created as part of this renewal. NAV was tightly integrated with Microsoft’s SQL Server and other Microsoft products, such as Office, Outlook, and SharePoint. Development is more integrated with Visual Studio Code and is more .NET-compliant. The product became more open and, at the same time, more sophisticated, supporting features such as web services access, web and tablet clients, integration of third-party controls, and RDLC and Word-based reporting.

Continuous enhancement

Business Central was made available from Microsoft as a cloud-based application in April 2018. Development changed from inline code changes to extensions. Extensions are a method of adding functionality to existing objects to modify a solution’s behavior. Microsoft continues to invest in, enhance, and advance Business Central. More capabilities and functionality are added with every new release. Business Central continues to be one of the fastest-growing products within the Microsoft organization.

AL language roots

One of the first questions asked by people new to AL is often, “What other programming language is it like?” The best response is Pascal enhanced with C# features.

At the time, the three founders of Navision were attending classes at DTU, Pascal was widely used as a preferred language, not only on computer courses but also on other courses where computers were tools and software had to be written for data analyses. Some of the strengths of Pascal as a tool in an educational environment also made it an ideal model for Navision’s business application development.

Perhaps coincidentally (or perhaps not), at the same time at DTU, a Pascal compiler called Blue Label Pascal was developed by Anders Hejlsberg. That compiler became the basis for what was Borland’s Turbo Pascal, which was considered the everyman’s compiler of the 1980s because of its low price. Anders went with his Pascal compiler to Borland. While he was there, Turbo Pascal morphed into the Delphi language and IDE tool set under his guidance.

Michael Nielsen, formerly of Navision and Microsoft, who developed the original C/AL compiler, runtime, and IDE, said that the design criteria provide an environment that can be used without the following tasks:

Dealing with memory and other resource-handlingThinking about exception handling and stateThinking about database transactions and rollbacksKnowing about set operations (SQL)Knowing about OLAP (SIFT)

Paraphrasing some of Michael’s additional comments, the goals of the language and IDE designs included the following:

Allowing a developer to focus on design rather than coding but still allowing flexibilityProviding a syntax based on Pascal stripped of complexities, especially relating to memory managementProviding a limited set of predefined object types and reducing the complexity and learning curve

Implementing database versioning for a consistent and reliable view of the database

The basic principles of Michael’s design for Navision still exist within the AL language and Visual Studio Code IDE for modern Business Central development.

Who this book is for

This book is for the following:

A business application designer or developer for whom the following is true:

Wants to become productive in AL development within Visual Studio Code as quickly as possibleUnderstands business applications and the type of software required to support those applicationsHas some programming experienceHas access to a Microsoft-hosted cloud instance of Business CentralIs willing to do exercises to get hands-on experience

The manager or executive (with technical experience) who wants a concise, in-depth view of Business Central’s extension development tool sets.

The technically knowledgeable manager or executive of a firm using Business Central that is about to embark on a significant Business Central enhancement project

The technically knowledgeable manager or executive of a firm considering the purchase of Business Central as a flexible and extendable business applications platform

The experienced business analyst, consultant, or advanced student of application software development who wants to learn more about Business Central, as it is one of the most widely used, and most flexible, business application systems available

The reader of this book does not need the following:

To be an expert in programmingPrevious experience with Business Central, AL, or Visual Studio Code

What this book covers

Chapter 1, Introduction to Business Central, starts with an overview of Business Central as a business application and functional terminology. It covers the basics of the base applications, 12 object types, and an introduction to Visual Studio Code integrated development environment (IDE). After stepping through setting up an AL project in Visual Studio Code, the chapter closes with an extended hands-on experience in the over-arching exercise scenario.

Chapter 2, Tables, focuses on the foundation level of Business Central’s data structure – tables and their components. This chapter covers properties, triggers (where AL business logic resides), field groups, table relations, and SumIndexFields. It will then present the hands-on creation and extension of several tables in support of an example application. The chapter will also review the types of tables found in Business Central applications.

Chapter 3, Data Types and Table Fields, will teach you about fields, the basic building blocks of Business Central’s data structure. It will review the different data types in Business Central and cover all its field properties and triggers in detail, as well as the different field classes.

Chapter 4, Pages – The Interactive Interface, reviews the different types of pages, their structures (triggers and properties), and general usage. The chapter will encourage you to build several pages for an example application using snippets. It will also explore the different types of controls and actions that can be used on pages. Client tools for page development and user search functions will be covered.

Chapter 5, Reports and Queries, delves into the data reporting capabilities of Business Central with report and query objects. Report structure, data flow, properties, and triggers are covered in detail. Layout formats including SQL Report Layout, Word, and Excel are reviewed. The chapter also covers ways that report objects can process as well as output data. An in-depth example of creating a report from scratch with a multi-sheet Excel layout allows you to build upon your knowledge so far. Query object structure, properties, and triggers, as well as use cases, are explored in detail.

Chapter 6, Introduction to AL, shows the level of flexibility Business Central has in implementing custom business logic. AL syntax, naming conventions, variables, operators, and frequently used AL methods are covered in detail. Custom procedures and data validation are discussed, along with an example of creating a sample report with a Word layout.

Chapter 7, Intermediate AL, digs deeper into AL development and techniques. It will review some more advanced built-in methods, including those relating to dates and decimal calculations—both critical business application tools. This chapter will also explore AL methods that support process flow control functions, CRUD operations, and filtering, before reviewing methods of communication between objects. Multi-language support and debugging are covered in detail. Finally, this chapter offers the opportunity to practically enhance an example application.

Chapter 8, Extensibility beyond AL, shows that developing in AL is not limited to data and processes inside a Business Central application. The various API types offered as input/output interfaces are discussed, and hands-on examples are available for XML and JSON data. We discuss the structure, properties, and triggers of Pages, Queries, XMLports, and codeunits used as SOAP and OData web services, as well as RESTful API pages. The final example in the sample solution involves using AL to access and consume an external API.

To get the most out of this book

To get the maximum out of this book as a developer, the following should apply:

You should be an experienced developerYou should know at least one programming languageYou should have IDE experienceYou should be knowledgeable about business applicationsYou should be good at self-directed study

If you have these attributes, this book will help you become productive with AL and Business Central much more rapidly.

Even though this book is targeted primarily at developers, it is also designed to be useful to executives, consultants, managers, business owners, and others who want to learn about the development technology and operational capabilities of Dynamics 365 Business Central.

If you fit into one of these, or similar, categories, start by studying Chapter 1 for a good overview of Business Central and its tools. You should then consider reviewing sections of other chapters, where specific topics may apply to your specific areas of interest.

Software/hardware covered in the book

Operating system requirements

Visual Studio Code

Windows, macOS, or Linux

Microsoft Office 365

Windows, macOS, or Android

Microsoft SQL Report Builder

Windows with .NET Framework 4.6

Web browser

Microsoft Edge, Google Chrome (77.0 or later), or Mozilla Firefox (69.0 or later) for Windows

Safari for macOS (12.0 or later)

This book’s illustrations are from the CRONUS International database, Dynamics 365 Business Central v24, and Visual Studio Code v1.92 for Windows.

To sign up for a free trial of Microsoft Dynamics 365 Business Central, follow the instructions on the Microsoft website:

https://learn.microsoft.com/en-us/dynamics365/business-central/trial-signup

To connect a Visual Studio Code AL project to an existing cloud sandbox environment, follow these instructions:

https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-troubleshoot-vscode-webclient

Note

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code. Each chapter is available as a separate branch of the main repository.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Programming-Microsoft-Dynamics-365-Business-Central-Seventh-Edition. If there’s an update to the code, it will be updated in the 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!

Conventions used

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

Code in text: 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: “Right-click on the RadioShows.xlsx file and open it in Microsoft Excel”

A block of code is set as follows:

part(ControlName; PartPageName) {     <properties> }

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “The easiest way to create a table is by using snippets.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

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

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/support/errata and fill in the form.

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.

Share Your Thoughts

Once you’ve read Programming Microsoft Dynamics 365 Business Central - seventh edition, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application. 

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/978-1-80323-641-4

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

1

Introduction to Business Central

“Time changes all things; there is no reason why language should escape this universal law.”

– Ferdinand de Saussure

“Computers are like Old Testament gods; lots of rules and no mercy.”

– Joseph Campbell

Microsoft Dynamics 365 Business Central has one of the largest installed user bases of any enterprise resource planning (ERP) system, serving over two hundred thousand companies and millions of individual users, at the time of writing. The community of supporting organizations, consultants, implementers, and developers continues to grow and prosper. The capabilities of the off-the-shelf product increase with every release. Additionally, the selection of add-on products and services expands both in variety and depth.

The release of Microsoft Dynamics Business Central continues its 30-plus-year history of continuous product improvement. It provides more user options for access and output formatting. For new installations, Business Central includes tools for rapid implementation. For all installations, it provides enhanced business functionality and more support for ERP computing in the cloud, including integration with Microsoft Office 365 and the greater Azure cloud architecture, including Power Platform (Power Automate, Power Apps, Power BI, and Power Virtual Agents).

Our goal in this chapter is to gain a big-picture understanding of Business Central. Upon completing this chapter, you will be able to envision how Business Central can be used by owners and managers of an organization to help manage activities and resources, whether the organization is for-profit or not-for-profit. You will also be introduced to the technical side of Business Central from a developer’s point of view.

In this chapter, we will take a look at Business Central by covering the following topics:

A general overview of Business CentralA technical overview of Business CentralA hands-on introduction to Visual Studio Code (VS Code) development in Business Central

Technical requirements

Developing for Business Central requires access to a Business Central environment, as well as Visual Studio Code installed as the source code editor.

Business Central (hosted by Microsoft in the Azure cloud) can be accessed from a modern browser (Microsoft Edge, Google Chrome, and Mozilla Firefox for Windows or Safari for macOS). Having a subscription to Office 365 is strongly recommended for Word, Excel, and emailing functionality.

Visual Studio Code (VS Code) is a small download (< 200 MB) and has a disk footprint of < 500 MB. It’s lightweight and should easily run on today’s hardware.

For an on-premises installation of VS Code, the following is required:

1.6 GHz or faster processor

1 GB of RAMWindows 10 and 11 (64-bit)macOS (current and previous two versions)Linux (Debian): Ubuntu Desktop 20.04, Debian 10

Linux (Red Hat): Red Hat Enterprise Linux 8, Fedora 36A https://github.com/PacktPublishing/Programming-Microsoft-Dynamics-365-Business-Central-Seventh-Edition.

For a complete list of VS Code requirements, please visit https://code.visualstudio.com/Docs/supporting/requirements.

Installing VS Code will be covered later in this chapter, in the The VS Code integrated development environment section.

Business Central – an ERP system

Business Central is an integrated set of business applications that are designed to service a wide variety of business operations. Microsoft Dynamics 365 Business Central is an ERP system. An ERP system integrates internal and external data across a variety of functional areas, including manufacturing, accounting, supply chain management, customer relationships, service operations, and human resource management, as well as managing other valued resources and activities. By having many related applications well integrated, a fully featured ERP system provides an enter data once, use many ways information processing toolset.

Business Central ERP addresses the following functional areas:

Financial Management (for example general ledger, accounts payable, and accounts receivable)Supply Chain Management (for example sales orders, purchase orders, shipping, inventory, and receiving)Relationship management (for example vendors, customers, prospects, employees, and contractors)Manufacturing (for example MRP, sales forecasting, and production forecasting)Other critical business areas (for example human resource management, project management, warehouse management, marketing, cash management, and fixed assets)A complete set of development tools that allow the application to be customized and expanded for specific industries, and even individual businesses.

These are not the only functional areas Business Central addresses, but the main ones. New areas are being added all the time, and many extensions are being produced that address more niche business needs.

A good ERP system, such as Business Central, is modular in design, which simplifies implementation, upgrading, modification, integration with third-party products, and expansion for different types of clients. All the modules in the system share a common database and, where appropriate, common data.

The following groupings of individual Business Central functions are based on the Search menu structure, which is supplemented by information from Microsoft marketing materials. The important thing to understand is the overall components that make up the Business Central ERP system:

Figure 1.1 – Fully integrated functional areas of Business Central

Business Central has a web browser role-tailored user interface (UI). In Business Central, there’s a universal web-based client that can be used on personal computers, tablets, and other mobile devices.

As illustrated in Figure 1.1, Business Central is a fully integrated system that has multiple functional areas. Let’s take a closer look at them.

Financial management

The foundation of any ERP system is financial management. Irrespective of the business, the money must be kept flowing and tracked. Business Central’s financial management module contains tools that can help you manage the capital resources of a business. These include all or part of the following application functions:

General ledger: Managing the overall finances of the firmCash management and banking: Managing the inventory of financial assetsAccounts receivable: Tracking the incoming revenueAccounts payable: Tracking outgoing fundsAnalytical accounting: Analyzing the various flows of fundsInventory and fixed assets: Managing inventories of goods and equipmentMulticurrency and multilingual: For supporting international business activities

Business Central is not just a financial system – it is the basis for all other functional areas. The main areas related to inventory consist of making goods, moving goods, and servicing goods. Other areas that don’t focus on inventory are project management, managing employees, customer communications, and internal reporting.

Manufacturing

Business Central manufacturing is general-purpose enough to be appropriate for Make to Stock (MTS), Make to Order (MTO), and Assemble to Order (ATO), as well as various subsets and combinations of those. Although Business Central is not particularly suitable for most process manufacturing and some of the very high-volume assembly line operations off the shelf, there are third-party extension enhancements available for those applications. As with most of the Business Central application functions, manufacturing can be implemented either in a basic mode or as a fully featured system. Business Central manufacturing includes the following functions:

Product design (Bills of Materials [BOMs] and routings) for the structure management of product components and the flow management of manufacturing processesCapacity and supply requirement planning, for tracking the intangible and tangible manufacturing resourcesProduction scheduling (infinite and finite), execution, and tracking quantities and costs, plus tracking manufacturing resources’ planned use, both on a constrained and unconstrained basis

Supply chain management

Some of the functions that are categorized as part of Business Central’s supply chain management (SCM), such as sales and purchasing, are actively used in almost every Business Central implementation. The supply chain applications in Business Central include all or parts of the following applications:

Sales order processing and pricing: To support the heart of every businessPurchasing (including requisitions): For planning, entering, pricing, and processing purchase ordersInventory management: For managing inventories of goods and materialsWarehouse management including receiving and shipping: For managing the receipt, storage, retrieval, and shipment of material and goods in warehouses

As a whole, these functions constitute the base components of a system that’s appropriate for distribution operations, including those that operate on an ATO basis.

Business intelligence and reporting

Although Microsoft marketing materials identify business intelligence (BI) and reporting as though they’re separate modules within Business Central, it’s difficult to physically identify them as such. Most of the components that are used for BI and reporting purposes are (appropriately) scattered throughout various application areas. In the words of one Microsoft document, business intelligence is a strategy, not a product. The following functions within Business Central support a BI strategy:

Standard reports: Distributed and ready to use by end usersFinancial reporting and analysis reports: A specialized report writer for general ledger dataQueries, XMLports, and reports: The AL programming language supports the creation of a wide variety of report formats [SQL Server Reporting Services (SSRS), Microsoft Word, and Excel], queries, XML, and CSV filesAnalysis by dimensions: A capability embedded in many Business Central toolsOffice 365 Interfaces: Including communicating Excel data either into or out of Business CentralRDLC report viewer: Allows you to present Business Central data in a variety of textual and graphic formats, including providing user interactive capabilitiesInterface capabilities such as SOAP, ODATA, and REST web services: Technologies to support interfaces between Business Central and external software productsStandard packages for Power BI: Integrated in the role center as well as dashboards

Relationship management

Business Central’s relationship management (RM) functionality is the little sibling of the fully featured standalone Microsoft CRM system and Dynamics 365 for Sales and Dynamics 365 for Marketing. The big advantage of Business Central RM is its tight integration with Business Central customer and sales data.

Also falling under the heading of the customer relationship module is the Business Central service management (SM) functionality. The following functionalities fall under RM and SM:

Relationship management:Marketing campaigns, to plan and manage promotionsCustomer activity tracking, to analyze customer ordersTo-do lists, to manage what is to be done and track what has been doneService management:Service contracts, to support service operationsWarranty tracking for items and repairLabor and part consumption tracking, to track resources that are consumed by the service businessPlanning and dispatching, to manage service calls

Human resource management

The Business Central human resources module is very small, but it relates to a critical component of the business: employees. Basic employee data can be stored and reported via the master table (in fact, you can use the human resources (HR) module to manage data about individual contractors in addition to employees). A wide variety of individual employee attributes can be tracked through the use of tailorable dimension fields:

Employee tracking: Maintain basic employee description dataSkills inventory: Inventory of the capabilities of employeesAbsence tracking: Maintain basic attendance informationEmployee statistics: For tracking government and other required employee attribute data, such as age, gender, and length of service

Project management

The Business Central project management module consists of allocating, budgeting, and utilizing resources for projects that can be either short-term or long-term. They can be external (in other words, billable) or internal. This module is often used by third parties as the base for vertical market add-ons (such as construction or job-oriented manufacturing). This application area includes parts or all of the following functions:

Budgeting and cost tracking, for managing project financesScheduling, for planning project activitiesResource requirements and usage tracking, for managing people and equipmentProject accounting, for tracking the results

Now that we’ve learned about Business Central at a functional level, let’s switch to a developer’s perspective.

A developer’s overview of Business Central

From the point of view of a developer, Business Central consists of a set of applications with thousands of potentially extensible, off-the-shelf program objects written in the AL programming language. Visual Studio Code, as the integrated development environment (IDE), in combination with the AL Language extension, allows us to work with existing objects and create new ones. Our AL code will compile into a *.app file as yet another application to publish and install.

Note

This book provides an overview of Business Central, including the basics, so that you have a quick hands-on start. To find the complete developer documentation, please refer to Microsoft Docs at https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/#resources-for-a-developer.

Business Central applications

As a developer, we need to be aware of the following applications that form the Business Central application. They have been listed in their dependency hierarchy from top to bottom:

Base Application: This provides core business processes such as sales and purchasing, customer and vendor management, plus complex processes, such as assembly, manufacturing, service, and directed warehouse management – simply put, the business logic.Business Foundation (since version 24): This serves as a foundation for developing business applications, such as No. series management or dimension management. The standard functionality is used globally and not tied to a specific area. Before version 24, the content resided in the Base Application.System Application: This contains objects to serve mere technical purposes, such as emailing, OAuth, and RegEx, and provides mathematical functions. These objects support the base application and its interaction with the platform and Microsoft ecosystem.System: This provides system objects and virtual tables. We will discuss some of these objects at the end of Chapter 2.

Tip

The Business Central source code is being developed at https://github.com/microsoft/BCApps. The repository is a contribution project. At the time of writing this book, the repository consisted of the System Application, the Business Foundation, and various tools. The Base Application will be added in the future. Please refer to the repository’s README file for more current information.

Business Central object types

Let’s start with basic definitions of the Business Central object types that will be covered in this book. This is meant to act as a rough overview – we will cover them later in this chapter again:

Table: Tables serve both to define the data structure and to contain the data records.Table extension: Table extensions allow for the creation of companion tables that are linked to tables defined by Microsoft in the base product or by other solutions.Page: Pages are the way data is formatted and displayed appropriately for each of the client types and user roles.Page extension: Page extensions allow controls in existing pages to be added or hidden.Report: Reports are provided to display data to the user in hard copy format, computer file format (PDF, Microsoft Word, or Excel), on-screen (preview mode), or via a printing device. Report objects can also update data in processes with or without data display.Report Extension: Report extensions allow you to add columns to existing reports’ datasets, add new data items, extend trigger logic, provide additional fields and logic to request pages, and define new layouts.Codeunit: Codeunits are containers for code that are utilized by other objects. Codeunits are always structured in code segments called procedures.Query: Queries support extracting data from one or more tables, making calculations, and outputting them in the form of a new data structure. Queries can output data directly into charts, Excel, XML, and OData. They can be used as an indirect source for pages and reports.XMLport: XMLports allow you to import and export data to/from external files. The external file structure can be in XML or other file formats.Profile: Profiles allow you to define Role Centers and group page customizations.Enum: Enums (enumerated lists) are extendable options that can be connected to tables and interfaces.Enum extension: Enum extensions are extra options that are added to Enums from either the Microsoft Business Central Base App or other extensions.

The Visual Studio Code integrated development environment

Business Central includes an extensive set of software development tools. These Business Central development tools can be accessed through Visual Studio Code and the AL Language extension. We will install the extension soon in the Extensions section, and we will learn about the AL Language extension in the AL programming language section.

The Visual Studio Code IDE is Microsoft’s most popular free code editor and is available for Windows, Linux, and macOS. The images used in this book have been taken on a Windows system. You can download Visual Studio Code from https://code.visualstudio.com/:

Figure 1.2 – Visual Studio (VS) Code with the AL Language extension installed

Let’s explore its interface in more detail.

Visual Studio Code icons

When we open Visual Studio Code, we will see five icons. These icons appear on the left-hand side of the screen. They also determine the navigation part that appears on the left-hand side of your screen. If you click on an icon twice, the navigation part will be hidden and allow full-screen code editing. Let’s see what each of these do in detail.

EXPLORER

The EXPLORER view is the default view when you open a project. It allows you to view the files in a project and select one or more files for editing. The EXPLORER view is shown in the following screenshot:

Figure 1.3 – EXPLORER in VS Code

While the list of files is fine for smaller projects, sometimes, it is necessary to locate a file in a larger list or even text within files.

Tip

We can use Ctrl + P to search files by name.

SOURCE CONTROL

VS Code provides access to a built-in connection to SOURCE CONTROL. When source control is activated, all changes that are made to files are automatically tracked and displayed in this window:

Figure 1.4 – SOURCE CONTROL in VS Code

Further reference

The video Using Git with Visual Studio Code (https://youtu.be/i_23KUAEtUM) explains how to get started with SOURCE CONTROL in Visual Studio Code.

Debugger

You can use the built-in debugger to do basic troubleshooting for your code. The RUN AND DEBUG view is shown in the following screenshot:

Figure 1.5 – The debugger in VS Code

We will learn more about debugging in Business Central in Chapter 7, Intermediate AL.

Extensions

Out of the box, Visual Studio Code doesn’t understand the Business Central AL Language syntax. To activate the compiler, an extension needs to be installed in the EXTENSIONS window.

This extension, called AL Language extension for Microsoft Dynamics 365 Business Central (in this book, it will be referred to as AL Language extension), can be downloaded from the Visual Studio Marketplace or installed directly from Visual Studio Code using Search Extensions in Marketplace:

Figure 1.6 – The AL Language extension in VS Code

Note

The Visual Studio Code Marketplace can be found at https://marketplace.visualstudio.com/.

Microsoft does a monthly update of Business Central and the AL Language extension. Usually, you install and use the most current version released in the Marketplace. There is also a pre-release version available that allows early access to features that are being prepared for the next major version of Business Central.

SEARCH

The SEARCH view provides an advanced search and replace option within the files of your project. The SEARCH view is shown in the following screenshot:

Figure 1.7 – SEARCH in VS Code

Visual Studio Code provides an easy-to-understand toolset that’s used by many programmers. The AL compiler extension provides an entry point for you to extend and develop new areas in the Microsoft 365 Business Central application. Later, we will get into the additional benefits of its deep integration with Git and repositories to control code development between one and more developers.

AL programming language

The language in which Business Central is coded is AL. A small sample of AL code within Visual Studio Code is shown here:

Figure 1.8 – Example of AL code

AL syntax is similar to Pascal syntax. But other than Pascal, AL is not an object-oriented programming language but an object-based one. Code readability is always enhanced by careful programmer attention to structure and logical variable naming, as well as ensuring that the process flow is consistent with that of the code in the base product and that there is good documentation both inside and outside of the code.

Good software development focuses on design before coding and accomplishing design goals with a minimal amount of code. Dynamics Business Central facilitates that approach. In 2012, a team made up of Microsoft and Business Central community members began the NAV design patterns project. As defined by Wikipedia, a design pattern is a general reusable solution to a commonly occurring problem.

In 2022, long after the transition to Business Central and the AL language, the project was relaunched as Business Central design patterns and moved to another website: https://alguidelines.dev/docs/.

Note

One of the primary goals of this project is to document patterns that exist within Business Central. In addition, new best practice patterns have been suggested as ways to solve common issues we encounter during our customization efforts. Now, when we work on Business Central enhancements, we will be aided by references to the documentation of patterns within Business Central. This allows us to spend more of our time designing a good solution using existing, proven procedures (the documented patterns) and less time writing and debugging code. Please refer to the Reusing Code section of Business Central at https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-programming-in-al#reusing-code for more information.

Much of our Business Central development work is done by assembling references to previously defined objects and procedures and adding new data structures where necessary. As the tools for Business Central design and development that are provided both by Microsoft and the Business Central community continue to mature, our development work becomes more oriented toward design and less toward coding. The result is that we are more productive and cost-effective on behalf of our customers. Everyone wins.

Business Central object elements

Here are some important terms that are used in Business Central:

Field: An individual data item, defined either in a table or in the working storage (temporary storage) of an object.Record: A group of fields (data items) that are handled as a unit in many operations. Table data consists of rows (records) with columns (fields).Control: In Microsoft Developer Network (MSDN), a control is defined as a component that provides (or enables) UI capabilities.Properties: These are the attributes of the element, such as an object, field, record, or control, that define some aspect of its behavior or use. Example property attributes include display captions, relationships, size, position, and whether the element is editable or viewable.Trigger: These are mechanisms that initiate (fire) an action when an event occurs and is communicated to the application object. A trigger in an object is either empty or contains code that is executed when the associated event fires the trigger. Each object type, data field, control, and so on may have its own set of predefined triggers. The event trigger name begins with On – for example, OnInsertRecord, OnOpenPage, or OnNextRecord. Business Central triggers have similarities to those in SQL, but they are not the same (similarly named triggers may not even serve similar purposes). Business Central triggers are locations within objects where a developer can place comments or AL code. Procedures: These can be defined by the developer. They are callable routines that can be accessed by other AL code from either inside or outside the object where the called procedure resides. Many procedures are provided as part of the standard product. As developers, we may add custom procedures as needed.Attributes: An attribute is a modifier on a procedure declaration that controls the procedure’s use and behavior.Object numbers and field numbers: All objects of the same object type are assigned a number that’s unique within the object type. All fields within a table object are assigned a number that’s unique within the object (that is, the same field number may be repeated within many objects, regardless of whether it is referring to similar or different data). In this book, we will generally use comma notation for these numbers (fifty thousand is 50,000). In AL, no punctuation is used. The object numbers range from 1 (one) to 49,999 and those from 100,000 to 999,999 are reserved for use by Business Central as part of the base product. Numbers from 1,000,000 (one million) to 74,999,999 are reserved for partners. Field numbers in standard objects often start with one (1). Historically, object and field numbers from 50,000 to 99,999 are generally available to the rest of us for assignment as part of extensions that are developed. Field numbers from 90,000 to 99,999 should not be used for new fields that have been added to standard tables as those numbers are sometimes used in training materials. Microsoft allocates ranges of object and field numbers to independent software vendor (ISV) developers for their add-on enhancements. Some such objects (the 14 million range in North America, and other ranges for other geographic regions) can be accessed, modified, or deleted, but they can’t be created using a normal development license. Others (such as in the 37 million range) can be executed but not viewed or modified with a typical development license. The following table summarizes this object numbering practice:

Object Number Range

Usage

1 – 9,999

Base application objects

10,000 – 49,999

Country-specific objects

50,000 – 99,999

Customer-specific objects

100,000 – 999,999

Localization-specific objects

1,000,000 – 74,999,999

Partner-created objects

Table 1.1 – BC object number ranges

Events: Procedures can subscribe to events that are raised in the system. Business Central has both platform and manual events. Procedures can also be used to raise events.Work date: This is a date that’s controlled by the user operator. It is used as the default date for many transaction entries. The system date is the date that’s recognized by Windows. The work date that can be adjusted at any time by the user is specific to the workstation and can be set to any point in the future or the past. This is very convenient for procedures such as the ending sales order entry for one calendar day at the end of the first shift, and then the second shift entering sales orders dated to the next calendar day. Some settings allow you to limit the range of work dates allowed. The work date can be set by clicking on the cogwheel drop-down list next to the question mark icon and selecting the My Settings option:

Figure 1.9 – Settings in the Business Central client

Clicking on My Settings in the dropdown displays the My Settings screen. Here, we can enter a new Work Date value:

Figure 1.10 – Work Date on the My Settings screen

In addition to basic functionality, you will also encounter terminology that’s used in the functional areas that are important to understand for development purposes.

Business Central functional terminology

For various application functions, Business Central uses terminology that’s more similar to accounting than to traditional data processing terminology. Here are some examples:

Journal: A table of unposted transaction entries, each of which represents an event, an entity, or an action to be processed. There are general journals for general accounting entries, item journals for inventory changes, and so on.Ledger: A detailed history of posted transaction entries that have been processed – for example, the general ledger, customer ledger, vendor ledger, and item ledger. Some ledgers have subordinate detail ledgers, typically providing a greater level of quantity and/or value detail. With minor exceptions, ledger entries cannot be edited. This maintains auditable data integrity. Business Central has a posting logic-driven data integrity that is founded on General Ledger Entries tying to all other ledgers.Posting: The process by which entries in a journal are validated, and then entered into one or more ledgers.Batch: A group of one or more journal entries, posted at the same time.Register: An audit trail showing a history, by entry number ranges, of posted journal batches.Document: A formatted page such as an invoice, a purchase order, or a payment check, typically one page for each primary transaction (a page may require display scrolling to be fully viewed).

UI

The Business Central UI is designed to be role-oriented (also called role-tailored). The term role-oriented means tailoring the available options to fit the user-specific job tasks and responsibilities.

The first page that a user will see is the Role Center page. The Role Center page provides the user with a view of work tasks to be done; it acts as the user’s home page. The Role Center home page should be tailored to the job duties of each user so there are a variety of Role Center page formats for any installation.

Someone whose role focuses on order entry will probably see a different Role Center home page than the user whose role focuses on invoicing, even though both user roles are in what we generally think of as sales and receivables. The Business Central tailorable Role Center allows a great deal of flexibility for implementers, system administrators, managers, and individual users to configure and reconfigure screen layouts and the set of functions that are visible to a particular user.

The following screenshot is the out-of-the-box Role Center for a business manager:

Figure 1.11 – Business Central – Role Center

The key to properly designing and implementing any system, especially a role-tailored system, is the quality of the user profile analysis that’s done as the first step in requirements analysis. User profiles identify the day-to-day needs of each user’s responsibilities, relative to accomplishing the business’s goals. Each user’s tasks must be mapped to individual Business Central functions or elements, identifying how those tasks will be supported by the system.

Important

A successful implementation requires the use of a proven methodology. The upfront work must be done and done well. The best programming cannot compensate for badly defined goals.

In our exercises, we will assume that the upfront work has been well done, so we will concentrate on addressing the requirements that have been defined by our project team.

Hands-on development in Business Central

One of the best ways to learn a new set of tools, such as those that make up a programming language and environment, is to experiment with them. We’re going to have some fun doing that throughout this book. To do so, we’re going to experiment where the cost of errors (otherwise known as learning) is small. Our development work will consist of a custom Business Central application that will be relatively simple but realistic.

We’re going to do our work using the Cronus demo database that is available with all Business Central distributions and is installed by default when we install the Business Central demo system. The simplest way is to use the sandbox.

Note

You can find up-to-date information on getting started with Business Central sandboxes via Microsoft Docs at https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-sandbox-overview.

The Cronus database contains all of the Business Central objects and a small, but reasonably complete, set of data populated in most of the system’s functional application areas. Our exercises will interface very slightly with the Cronus data, but they will not depend on any specific data values already there.

Business Central development exercise scenario

Our business is a small radio station that features a variety of programming, news, music, listener call-ins, and other program types. Our station call letters are WDTU. Our broadcast materials come from several sources and in several formats: vinyl records, CDs, MP3s, and downloaded digital (usually MP3s). While our station has a large library, especially of recorded music, sometimes, our program hosts (also called disc jockeys or DJs