Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Microsoft Dynamics 365 Business Central

You're reading from  Mastering Microsoft Dynamics 365 Business Central

Product type Book
Published in Dec 2019
Publisher Packt
ISBN-13 9781789951257
Pages 770 pages
Edition 1st Edition
Languages
Authors (2):
Stefano Demiliani Stefano Demiliani
Profile icon Stefano Demiliani
Duilio Tacconi Duilio Tacconi
Profile icon Duilio Tacconi
View More author details

Table of Contents (25) Chapters

Preface Section 1: Dynamics 365 Business Central - Platform Overview and the Basics of Modern Development
Microsoft Dynamics 365 Business Central Overview Mastering a Modern Development Environment Online and Container-Based Sandboxes Section 2: Developing Extensions for Dynamics 365 Business Central
Extension Development Fundamentals Developing a Customized Solution for Dynamics 365 Business Central Advanced AL Development Report Development with AL Section 3: Debugging, Testing, and Release Management (DevOps)
Installing and Upgrading Extensions Debugging Automated Test Development with AL Source Control Management and DevOps with Business Central Section 4: Advanced Integrations with Dynamics 365 Business Central
Dynamics 365 Business Central APIs Serverless Business Processes with Business Central and Azure Monitoring, Scaling, and CI/CD with Azure Functions Business Central and Integration with the Power Platform Section 5: Moving Solutions to the New Extension Model
Integrating Machine Learning into Dynamics 365 Business Central Moving Existing ISV Solutions to the New Extension Model Useful and Proficient Tools for AL Developers Other Books You May Enjoy

Developing a Customized Solution for Dynamics 365 Business Central

In the previous chapter, we saw the fundamentals of extension development for Dynamics 365 Business Central and we analyzed all of the building blocks for creating extensions, such as events and basic objects definitions, and how to extend standard objects.

In this chapter, we'll put all of these concepts together and create a real-world extension for Dynamics 365 Business Central. These extensions will be created by using AppSource guidelines and best code practices.

This chapter will cover the following topics:

  • Translating a business case into a real-world extension
  • Understanding dependent extension

Translating a business case into a real-world extension

In this section, let's imagine having a Dynamics 365 Business Central customer with various business requirements. We want to create an extension to satisfy this customer's needs.

Our customer is a big commercial company that has adopted Dynamics 365 Business Central as the company's ERP and has various business requirements that require customization of the standard features to be satisfied.

The business requirements are as follows:

  • Sales: These requirements include the following:
    • The company wants to classify customers based on custom categories that they can define as needed and that can change in the future. Each Customer Category must have its own details that can be used for some business processes.
    • The sales office must be able to create a default Customer Category and assign this default value...

Understanding a dependent extension

In the previous sections, we developed our extension and deployed it.

Imagine now that you've deployed this extension to a customer tenant and now the customer asks you for some customization:

  • They want to add the Certification No. field to the Vendor Quality table.
  • They want to change the gift assignment logic by always assigning a fixed gift quantity of 2.

To create a customization for your customer, you should never directly modify your standard extension code, but instead, you should create a new extension that will be dependent on your base extension.

To do this, we create a new extension project in Visual Studio Code called PacktDemoDependencyExtension. This new extension must be dependent on our previously created PacktDemoExtension; otherwise, we won't be able to see the objects defined in that extension.

First, we need...

Summary

In this chapter, we saw the implementation of a real-world extension for Dynamics 365 Business Central. We defined the backend of our solution (tables) and we created the pages (the user interface) and the required business logic (codeunits and events) according to the initial needs of the business. We saw how to make our code extensible by using the Handled pattern and how to create installation and upgrade code.

In the last part of this chapter, we created a new extension that modifies the standard behavior of our base extension, and we looked at the concept of dependency between extensions.

You have also learned how to create extensions with objects and events, how to use coding rules, and how to create customizations without modifying the base code of your application.

In the next chapter, we'll see how to handle some advanced topics with AL and the extension...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Microsoft Dynamics 365 Business Central
Published in: Dec 2019 Publisher: Packt ISBN-13: 9781789951257
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}