Adding a field in an extension in Microsoft Dynamics Business Central or NAV
ArcherPoint
12,385
How To: Add a Field in an Extension in Microsoft Dynamics Business Central/NAV
This blog explains how to add a field in an extension in Microsoft Dynamics NAV or Business Central. The steps involved are:
- Creating a table extension
- Adding a field to the table
- Creating a page extension
- Placing the field on the page
Step 1: Create a Table Extension
- Select View ->Command palette ->AL:Go!
- In launch.json (Figure1), change the following requirements as needed (see example in Figure 2):
Figure 1 - launch.json in Microsoft Dynamics Business Central/NAV
Figure 2 - Modified launch.json in Microsoft Dynamics Business Central/NAV - You might get an error in Helloworld.al. Following is how to correct it:
Figure 3 - HelloWorld .al in Microsoft Dynamics Business Central/NAV
Figure 4 - Navigating through view menu in Microsoft Dynamics Business Central/NAV - Download the symbols and make sure there are no errors in Helloworld.al.
Figure 5 - Downloading the symbols in Microsoft Dynamics Business Central/NAV - If the errors are cleared, delete the al file.
Figure 6 - Error-free modified HelloWorld.al in Microsoft Dynamics Business Central/NAV
Figure 7 - Deleting the HelloWorld.al in Microsoft Dynamics Business Central/NAV - Create a new file for the table extension.
Figure 8 - Creating a new file for a table extension in Microsoft Dynamics Business Central/NAV - Create the table extension using ttable ext snippet.
Figure 9 - Creating a new table extension in Microsoft Dynamics Business Central/NAV - Add the extension name, id, and table name to extend. Remove the selected area in the field for adding the table field.
Figure 10 - Adding the table id and name in Microsoft Dynamics Business Central/NAV
Step 2: Add the Table Field
- Add a field to the table using the tfield snippet.
Figure 11 - Creating new table field in Microsoft Dynamics Business Central/NAV - Add the following details according to the requirement. Add the field id, field name, and data type.
Figure 12 - Adding a field to a table in Microsoft Dynamics Business Central/NAV
Step 3: Create a Page Extension
- Create the page extension file.
- In it, create a new page extension using the snippet.
Figure 13 - Page extension using snippet in Microsoft Dynamics Business Central/NAV - Write the id, name of the extension, and table name.
Figure 14 - Page extension of item card in Microsoft Dynamics Business Central/NAV - Design the layout portion (adding the code to where the field is needed).
Step 4: Place the Field in the Page
- Choose the location where the field is needed.
Figure 15 - Selecting the field location in Microsoft Dynamics Business Central/NAV
Figure 16 - Adding the page field in Microsoft Dynamics Business Central/NAV - In Figure 16, you will see that the field ItemStatus is needed after the item category code. After adding publish it using AL, publish or press F5.
Figure 17 - Publishing an extension in Microsoft Dynamics Business Central/NAV - The output will look like Figure 17.
Figure 18 - A field added in an extension in Microsoft Dynamics Business Central/NAV
If you have any questions about Microsoft Dynamics NAV or Business Central functionality, contact ArcherPoint.
Read more "How To" blogs from ArcherPoint for practical advice on using Microsoft Dynamics Business Central or NAV. If you are interested in NAV/Business Central development, check out our collection of NAV Development Blogs.
- Anupa Harikumar's blog
- Log in or register to post comments
This was originally posted here.
*This post is locked for comments