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

Creating a list page

Now, we will create a list page for the table we created earlier. A list page is the initial page that is displayed when a user initally accesses any data table for the first time. The Business Central Development Environment has wizards (object generation tools) to help you create basic pages. Generally, after our wizard work is done, we will spend additional time in the page design tool to make the layout ready for users.

Our first list page will be the basis for viewing our Radio Show master records. From Visual Studio Code, click on New, then click on File. A New Page screen will appear. Click on New, type in the name of the file to be saved, and then click on Save. Enter the name (Radio Show Page.al). Now, we can use the snippet for the list pages called tpage:

Now we will set ID to 50100 and the name to "Radio Show List" , and change the SourceTable to "Radio Show", as shown in the following screenshot:

After doing this, we can see that NameSource is highlighted as a problem, and the PROBLEMS window at the bottom of our screen tells us that NameSource does not exist in the context.

The reason why this problem is occurring is because of the combination of the table object and this page. We joined these objects by selecting the Radio Show table as SourceTable for this page. By joining them, the page object now has a dependency on the table object.

The next step will be to add the fields from the table to the page in the repeater. We will remove the NameSource field to do so.

We should also remove everything we do not need, such as FactBoxes and actions:

We can Preview the page by making a modification to the launch.json file. Change the startupObjectId to 50100 and select AL: Publish without debugging from the Command Palette, as shown in the following screenshot:

This will launch the Business Central application with our newly created page as the startup object:

Because our table does not contain any data, we will only see a header with the name of our page.