Mastering Microsoft Dynamics 365 Business Central

Book description

Develop customized business management solutions with the latest features of Microsoft Dynamics 365 Business Central

Key Features

  • Learn Dynamics 365 Business Central, the next generation of Dynamics NAV
  • Explore advanced topics for handling complex integrations such as using APIs, OData, and Azure Functions
  • Discover best practices for developing SaaS extensions and moving existing solutions to the cloud

Book Description

Dynamics 365 Business Central is an all-in-one business management solution, which is easy to adopt and helps you make smarter business decisions. This book is a comprehensive guide to developing solutions with Microsoft ERP (in the cloud and also on-premises). It covers all aspects of developing extensions, right from preparing a sandbox environment to deploying a complete solution.

The book starts by introducing you to the Dynamics 365 Business Central platform and the new Modern Development Environment. You'll then explore the sandbox concept, and see how to create sandboxes for development. As you advance, you’ll be able to build a complete advanced solution for Dynamics 365 Business Central with AL language and Visual Studio Code. You'll then learn how to debug and deploy the extension and write automatic testing. The book will also take you through advanced topics like integration (with Azure Functions, web services, and APIs), DevOps and CI/CD techniques, and machine learning. You'll discover how Dynamics 365 Business Central can be used with Office 365 apps. Finally, you'll analyze different ways to move existing solutions to the new development model based on extensions.

By the end of this book, you'll be able to develop highly customized solutions that meet the requirements of modern businesses using Dynamics 365 Business Central.

What you will learn

  • Create a sandbox environment with Dynamics 365 Business Central
  • Handle source control management when developing solutions
  • Explore extension testing, debugging, and deployment
  • Create real-world business processes using Business Central and different Azure services
  • Integrate Business Central with external applications
  • Apply DevOps and CI/CD to development projects
  • Move existing solutions to the new extension-based architecture

Who this book is for

If you're a new developer looking to get started with Dynamics 365 Business Central, this book is for you. This book will also help experienced professionals enhance their knowledge and understanding of Dynamics 365 Business Central.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Mastering Microsoft Dynamics 365 Business Central
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the authors
      1. About the contributors
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Section 1: Dynamics 365 Business Central - Platform Overview and the Basics of Modern Development
  7. Microsoft Dynamics 365 Business Central Overview
    1. Understanding the customer perspective
    2. Understanding the partner's perspective
      1. An example of Dynamics 365 Business Central Admin Center portal
        1. Environments
        2. Notification recipients
        3. Telemetry
        4. Reported production outages
          1. How it works behind the scenes
    3. Under the skin of Dynamics 365 Business Central
      1. Regional control planes
      2. Regional data planes
        1. Data-tier
    4. Understanding the future perspective
      1. Proactive scenarios (Microsoft listens)
        1. New event requests
      2. Reactive scenarios (Microsoft acts)
    5. Summary
  8. Mastering a Modern Development Environment
    1. Mastering Visual Studio Code
      1. Code editor
      2. Status bar
      3. View bar
      4. Sidebar
      5. EXPLORER (Ctrl + Shift + E)
      6. SEARCH (Ctrl + Shift + F)
      7. SOURCE CONTROL (Ctrl + Shift + G)
      8. DEBUG (Ctrl + Shift + D)
      9. EXTENSIONS (Ctrl + Shift + X)
      10. Manage
        1. Command Palette
      11. Panels area
        1. PROBLEMS
        2. OUTPUT
        3. DEBUG CONSOLE
        4. TERMINAL
    2. Visual Studio Code – the editing features
      1. Comment lines
      2. Delimiter matching
      3. Text selection
      4. Code block folding
      5. Multiple cursors (or multi-cursor)
      6. Mini-map
      7. Breadcrumbs
      8. IntelliSense
      9. Word completion
      10. The Go To Definition
      11. Find All References
      12. Peek Definition
      13. Renaming symbols
    3. Understanding the AL Language extension
      1. AL Language
      2. launch.json
      3. app.json
        1. System and base application
        2. Platform
        3. Runtime
    4. Understanding symbols
      1. Inside symbols
    5. Understanding AL Language extension configuration
    6. Mastering AL Language code snippets
    7. Summary
  9. Online and Container-Based Sandboxes
    1. Creating online sandboxes
      1. Online sandboxes–pros and cons
    2. Introducing Docker
      1. Some base mechanisms when using Docker
        1. Environment variables
        2. Volumes
        3. Networks and ports
      2. Scenarios where Docker is especially useful for Dynamics 365 Business Central sandboxes
    3. Locally available environments using pure Docker commands
      1. Your first container
        1. Pulling new image versions
    4. Connecting to an existing SQL Server
    5. Handling your running containers with Docker cmdlets
    6. Creating locally available environments using navcontainerhelper
      1. Installing navcontainerhelper and keeping it updated
        1. Your first container
    7. Pulling new image versions
      1. Using more environment parameters, a volume, and port mapping
        1. Connecting to an existing SQL Server
    8. Handling your running containers with NavContainerHelper
    9. Centrally available on-premise environments
    10. Containers hosted on Azure VMs
    11. Choosing the right image
      1. Modifying scripts inside standard images
      2. Creating your own images
    12. Summary
  10. Section 2: Developing Extensions for Dynamics 365 Business Central
  11. Extension Development Fundamentals
    1. Technical requirements
    2. Basic concepts regarding extensions
    3. Understanding the basics of the AL Language
      1. Table definition
      2. Page object definition
      3. Table extension definition
      4. Page extension definition
      5. Codeunit definition
      6. Event definitions
      7. XMLport definition
      8. Defining query objects
      9. Extending the options – enums
      10. Creating a profile object
    4. Understanding AL project structure best practices
    5. Naming guidelines and AL object ranges
    6. Working on AL coding guidelines
    7. Summary
  12. Developing a Customized Solution for Dynamics 365 Business Central
    1. Translating a business case into a real-world extension
      1. Customer Category implementations
        1. Tables definition
        2. Pages definition
        3. The tableextension definition
        4. The pageextension definition
        5. Codeunit definition
      2. Gift campaign implementations
        1. Table definition
        2. Page definition
        3. Codeunit definition
      3. Vendor quality implementations
        1. Table definition
        2. Page definition
        3. The pageextension definition
        4. Codeunit definition
      4. Creating page views
      5. Installing and upgrading codeunits
    2. Understanding a dependent extension
    3. Summary
  13. Advanced AL Development
    1. Understanding immutable keys
    2. Handling files with AL
    3. Handling attachments
    4. Reading and writing text data to and from BLOB fields
    5. Using XMLports in AL code
    6. Creating and extending Role Centers
      1. Customizing the Headline
    7. Handling XML and JSON files with the AL language
    8. Consuming web services and APIs from AL
    9. Publishing Dynamics 365 Business Central objects as web services from AL
    10. Using Azure Functions to replace .NET code
    11. Understanding Isolated Storage
    12. Working with control add-ins
      1. Creating a timer-based control add-in
    13. Notifications inside Dynamics 365 Business Central
    14. Understanding page background tasks
    15. Summary
  14. Report Development with AL
    1. Anatomy of the AL report object
    2. Tools to use for Word and RDL layouts
      1. RDL and Word layout features
        1. Part 1 – Designing the dataset
        2. Part 2 – Creating a simple RDL layout
          1. Part 2.1 – Creating the RDL report header
          2. Part 2.2 – Adding a table control to the RDLC report body
        3. Part 3 – Understanding grouping
        4. Part 4 – Building a simple request page
        5. Part 5 – Adding database images
        6. Part 6 – Adding a Word layout
    3. Converting an existing C/AL report into AL
    4. Feature limitation when developing an RDL or Word layout report
    5. Understanding report performance considerations
    6. Summary
  15. Section 3: Debugging, Testing, and Release Management (DevOps)
  16. Installing and Upgrading Extensions
    1. Deploying extensions
      1. Automatically
      2. Manually
        1. Some deployment tips
      3. Deployment under the hood
    2. Deploying the main extension
      1. Deploying a dependent extension
    3. Deploying a new version of the main extension
      1. Deploying a new version of the dependent extension
    4. Summary
  17. Debugging
    1. Running in debug mode
      1. Visual Studio Code debugger sections
        1. Debugger sidebar
          1. Variables
          2. Watch
          3. Callstack
          4. Breakpoints
        2. Debugger toolbar
        3. Debugging in attach mode
        4. Non-debuggable items
        5. Mastering debugger issues
    2. Understanding code analyzers
      1. al.codeAnalyzers[]
      2. al.ruleSetPath
    3. Understanding Event Recorder
    4. Summary
  18. Automated Test Development with AL
    1. Test automation and testing design principles
    2. Designing tests with ATDD
    3. Preparing the environment
    4. Setting up test development for extensions
      1. Setting up our Visual Studio Code test project
    5. Learning about the technique behind test code
    6. Designing our test scenarios
      1. Test codeunit and test function – test example 1
      2. asserterror – test example 2
      3. Test page – test example 3
      4. UI handlers – test example 4
    7. Implementing our test scenarios
      1. Test codeunit and test function – test example 1
        1. Create a test codeunit
        2. Embed the requirement
        3. Writing the test story
        4. Constructing the real code
          1. CreateNonBlockedCustomerCategory
          2. CreateCustomer
          3. SetCustomerCategoryOnCustomer
          4. VerifyCustomerCategoryOnCustomer
        5. Running the test
      2. asserterror – test example 2
        1. Creating a test codeunit
        2. Embedding the requirement
        3. Writing the test story
        4. Constructing the real code
          1. CreateBlockedCustomerCategory
          2. VerifyBlockedCategoryErrorThrown
        5. Running the test
        6. Testing the test
      3. Test page – test example 3
        1. Creating a test codeunit
        2. Embedding and writing
        3. Constructing the real code
          1. CreateNonBlockedDefaultCustomerCategory
          2. CreateCustomerWithCustomerCategoryNotEqualToDefault
          3. SelectAssignDefaultCategoryActionOnCustomerCard
          4. VerifyCustomerHasDefaultCustomerCategory
        4. Running the test
        5. More examples for the Customer Category feature
      4. UI handler – test example 4
        1. Creating a test codeunit
        2. Embedding and writing
        3. Constructing the real code
          1. CreatePacktSetupWithGiftToleranceQty
          2. The CreateCustomerWithNonBlockedCustomerCategoryWithFreeGiftsAvailable helper function
          3. CreateItem
          4. CreateGiftCampaignForItemAndCustomerCategoryWithMinimumOrderQuantity
          5. CreateSalesInvoiceForCustomerWithLineForItem
          6. SetQuantityOnInvoiceLineSmallerThanMinimumOrderQuantityAndWithinGiftToleranceQty
        4. Running the test
          1. VerifyActivePromotionMessageIsDisplayed
    8. Summary
  19. Source Control Management and DevOps with Business Central
    1. Understanding Azure DevOps and what it offers
      1. Creating an Azure DevOps account and project
    2. Managing tasks, sprints, and boards in Azure DevOps
    3. Creating a repository for your code
    4. Managing repositories
      1. Security
      2. Options
    5. Branching policies
    6. Branching strategies
      1. Only a master branch
      2. Feature/developer branches
      3. Release branching
      4. Other strategies
      5. Git flow
      6. GitHub flow
      7. Branching considerations
    7. Understanding Git merge strategies
      1. Fast-forward merge
      2. Squash commit
      3. Rebase
      4. Git merge considerations
    8. Exploring Git with Visual Studio Code
      1. Visual Studio Code GUI for Git
      2. Workflow with Git
      3. Merges
    9. Understanding Azure DevOps Pipelines
      1. Agents
      2. Creating a build pipeline
      3. Variable groups and secure files
    10. Understanding the YAML pipeline
      1. Creating a YAML pipeline
      2. YAML pipeline templates
      3. Release pipeline
    11. Summary
  20. Section 4: Advanced Integrations with Dynamics 365 Business Central
  21. Dynamics 365 Business Central APIs
    1. Comparing OData and APIs in Dynamics 365 Business Central
    2. Using Dynamics 365 Business Central standard APIs
    3. Creating a custom API in Dynamics 365 Business Central
      1. Implementing a new API for a custom entity
      2. Implementing a new API for an existing entity
    4. Creating an application that uses Dynamics 365 Business Central APIs
    5. Using bound actions
    6. Using Dynamics 365 Business Central webhooks
    7. Working with Dynamics 365 Business Central APIs in Microsoft Graph
    8. Automation APIs in Dynamics 365 Business Central
    9. Summary
  22. Serverless Business Processes with Business Central and Azure
    1. Technical requirements
    2. Overview of Microsoft Azure serverless services
    3. Getting an overview of Azure Functions
    4. Developing an Azure function with Visual Studio
      1. Testing the Azure function locally
      2. Deploying the function to Azure
    5. Developing an Azure function with Visual Studio Code
      1. Testing your Azure function locally
      2. Publishing your function to Azure
    6. Calling an Azure function from AL
    7. Interacting with Azure Blob Storage to handle files in the cloud
      1. Creating an Azure Blob Storage account
      2. Creating Azure functions with Visual Studio
        1. The UploadFile function
        2. The DownloadFile function
        3. The ListFiles function
      3. Deploying the Azure functions
      4. Managing Azure Functions keys
      5. Testing the Azure functions
      6. Writing the Dynamics 365 Business Central extension
        1. Codeunit definition
        2. The pageextension definition
      7. Testing our application
    8. Summary
  23. Monitoring, Scaling, and CI/CD with Azure Functions
    1. Technical requirements
    2. Monitoring Azure Functions
    3. Scaling Azure Functions
      1. Azure Functions and DevOps
    4. Summary
  24. Business Central and Integration with the Power Platform
    1. Technical requirements
    2. Introducing the Power Platform
    3. Understanding Flow
    4. Understanding PowerApps
    5. Integration scenarios with Power Platform
      1. Scenario 1 – creating a human resources recruiting/onboarding process
      2. Scenario 2 – creating a simple sales order approval workflow
      3. Scenario 3 – creating a simple app to list all customers and sales quotes
    6. Summary
  25. Section 5: Moving Solutions to the New Extension Model
  26. Integrating Machine Learning into Dynamics 365 Business Central
    1. What are AI and ML?
    2. An overview of the ML process
    3. Understanding the Business Central ML Framework
      1. The Time Series API
        1. Step 1 – Downloading the dataset to Dynamics 365 Business Central
        2. Step 2 – Publishing a model as a web service from a public template
        3. Step 3 – Sending your data from Business Central to the ML endpoint to get predictions
    4. Understanding the ML Prediction API
      1. Step 1 – Publishing a general prediction model as a web service from a public template
      2. Step 2 – Training the ML model from AL
      3. Step 3 – Predicting using the trained model
      4. Step 4 – Getting insights into how ML works
      5. Step 5 – Publishing and running the forecast
    5. Summary
  27. Moving Existing ISV Solutions to the New Extension Model
    1. Preparing the transition from C/AL to AL and extensions
    2. Planning the number of extensions to code
    3. Converting existing solutions into AL
      1. C/AL to AL conversion
      2. C/AL to AL code customizations
      3. Upgrading from Dynamics 365 Business Central version 14 to version 15
    4. Handling customer-specific personalization's
    5. Other things to remember
      1. Handling the MenuSuite
      2. .NET variables and add-ins
      3. File management
      4. Printing
    6. Dynamics 365 Business Central wave 2 release changes
    7. Summary
  28. Useful and Proficient Tools for AL Developers
    1. Who is Waldo?
    2. What tools to use
      1. The AL Extension Pack
      2. The CRS AL Language Extension
        1. Run objects
        2. Renaming/reorganizing files
        3. Search on Google/Microsoft Docs
        4. Snippets
        5. Feedback
      3. WaldoNavPad
        1. How to get it to work
        2. Running the app for the first time
        3. The background
        4. Implementing the logic
      4. MostUselessAppEver
      5. PowerShell tools
        1. GitHub
        2. Docker scripts
        3. Publishers
      6. ALOps
        1. DevOps extension
        2. Steps
        3. Documentation on GitHub
        4. App templates
        5. Example of using ALOps
    3. Summary
  29. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Mastering Microsoft Dynamics 365 Business Central
  • Author(s): Stefano Demiliani, Duilio Tacconi
  • Release date: December 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781789951257