Exercise - Create a List page
Simon creates the List page and follows the naming standards, guaranteeing that users can't edit information. When a user double-clicks a course, the Course Card page displays the selected course. Simon also makes sure that the New, Edit, and View actions work as expected.
Tasks
Create a List page with fields by using code snippets.
Set the basic page and field properties.
Steps
Select File > New File and then immediately save this file by selecting File > Save. Name the file CourseList.Page.al.
Create a new page in this file by using code snippets. Enter tpage and press the Tab key.
Change the ID to 50101 and the Name to CRONUS Course List.
Set the SourceTable property to CRONUS Course and set the Caption property to Course List.
Set the PageType property to List and set the UsageCategory property to Lists. Verify that the ApplicationArea property is set to All.
Set the Editable property to false.
Set the CardPageId property to CRONUS Course Card.
Verify that a content area was created in the layout section. If not, create an area called content.
Remove the group in the area content and add a repeater with the name General.
Add the following fields in the repeater: Code, Name, Description, Price, Instructor Name.
Verify that the ApplicationArea property is set to All for all fields on the page.
Open the Course.Table.al file and set the LookupPageId and DrillDownPageId properties to CRONUS Course List.
Open the launch.json file in the .vscode folder, and then set the startupObjectId setting to 50101 and the startupObjectType to Page.
Publish your extension to the sandbox. Select View and Command Palette... (Ctrl+Shift+P).
Enter AL: Publish (F5) in the search box and select the command from the list.
Verify that the Dynamics 365 Business Central application launches and the Course List page appears. Now, you can enter data.
Enter the following data by selecting the New button in the menu. You can select any instructor that you want.
Code | Name | Description | Type | Duration | Price | Active | Difficulty | Passing Rate |
---|---|---|---|---|---|---|---|---|
80040 | Installation & Configuration | Basic knowledge of installation and configuration | Remote Training | 2 | 1,000 | Yes | 5 | 75 |
80042 | AL Introduction | Introduction to programming | Instructor Led | 5 | 2,500 | Yes | 8 | 80 |
80043 | Introduction | Introduction to Microsoft Dynamics 365 Business Central | Remote Training | 2 | 1,000 | Yes | 4 | 60 |
80049 | Application Setup | Basic knowledge of application setup | E-Learning | 2 | 1,000 | Yes | 5 | 65 |
80050 | Business Intelligence | Basic knowledge of Business Intelligence | E-Learning | 1 | 500 | Yes | 5 | 65 |