Book Image

Programming Microsoft Dynamics 365 Business Central - Sixth Edition

By : Marije Brummel, David Studebaker, Christopher D. Studebaker
Book Image

Programming Microsoft Dynamics 365 Business Central - Sixth Edition

By: Marije Brummel, David Studebaker, Christopher D. Studebaker

Overview of this book

Microsoft Dynamics 365 Business Central is a full ERP business solution suite with a robust set of development tools to support customization and enhancement. These tools can be used to tailor Business Central's in-built applications to support complete management functions for finance, supply chain, manufacturing, and operations. Using a case study approach, this book will introduce you to Dynamics 365 Business Central and Visual Studio Code development tools to help you become a productive Business Central developer. You'll also learn how to evaluate a product's development capabilities and manage Business Central-based development and implementation. You'll explore application structure, the construction of and uses for each object type, and how it all fits together to build apps that meet special business requirements. By the end of this book, you'll understand how to design and develop high-quality software using the Visual Studio Code development environment, the AL language paired with the improved editor, patterns, and features.
Table of Contents (12 chapters)
9
Successful Conclusions

Codeunits

A codeunit is a container for chunks of AL code to be called from other objects. These chunks of code are called procedures. Procedures can be called from any of the other Business Central object types that can contain AL code. Codeunits can also be exposed (published) as web services. This allows the procedures within a published codeunit to be invoked by external routines.

Codeunits are suited structurally to contain only procedures. Even though procedures could be placed in other object types, the other object types have superstructures that relate to their designed primary use, such as pages, and reports.

Codeunits act only as containers for AL coded procedures. They have no auxiliary procedures, no method of direct user interaction, and no predefined processing. Even if we are creating only one or two procedures and they are closely related to the primary activity of a particular object, and if these procedures are needed from both inside and outside of the report, the best practice is still to locate the procedures in a codeunit.

There are several codeunits being delivered as part of the standard Business Central product, which are really function libraries. These codeunits consist completely of utility routines, and are generally organized on some functional basis (for example, associated with dimensions, some aspect of manufacturing, or some aspect of warehouse management). Many of these can be found by filtering the codeunit names on the Management and Mgt strings (the same could be said for some of the tables with the Buffer string in their name). When we customize a system, we should create our own procedure library codeunits to consolidate our customizations and make software maintenance easier. Some developers create their own libraries of favorite special procedures, and include a procedure library codeunit in systems on which they work.