Exercise - Create a page extension
Simon wants to input social media information by using the customer card. Then, Simon wants to create a page extension that will extend the customer card and save it.
Tasks
Use snippets to create a page extension.
Add extra fields to an existing Card page.
Steps
Select File > New File and save the file by selecting File > Save. Name the file SocialMediaCard.PageExt.al.
Create a new page extension in the file by using code snippets. Enter tpageext and press the Tab key.
Change the ID to 50110 and the Name to CRONUS Social Media Card.
Make sure that the page extension extends the Customer Card page.
Remove the Action section and the variable myInt.
Add fields to a new group called Social Media. Add this group after the General group.
Use the addafter(General) keyword.
Define a group as Social Media in the addafter section.
Set the Caption property to Social Media.
Add the following fields to the Social Media group:
Open the launch.json file in the .vscode folder, and then set the startupObjectId setting to 22 and the startupObjectType to Page.
Publish your extension to the sandbox. Select View > 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 that the Customer List page appears.
Test your extension by opening a random customer record. Your fields should appear in a new Social Media FastTab, which is located under the General FastTab.