Skip to content

How To: Create a Customer Requirement in Microsoft Dynamics Business Central or NAV 

This blog explains how to create a simple Customer Requirement in Microsoft Dynamics Business Central or NAV. Requirements are:

Creating a Customer Requirement using AL code for Dynamics Business Central or NAV

  • Add a new Table and Page Designation containing three fields: Code, Description and Disabled
  • Add a new Field in the Resource table, Designation Code
  • The user should be able to select the Designation Code in the Resource Card from the new Table
  • When the user selects Resource in Sales Order Lines, the Designation Code selected in the Resource Card should be available in the Sales Order Lines Page
  • If the user increases the Quantity in the Sales order line to more than 20, the Designation code should set to Blank
  • The user should also be able to select the Designation Code in the Sales Order Lines Page.

A table is a collection of related data held in a structured format of columns and rows within a database. In Business Central/NAV you have a table where you store your customer information, a table for vendor data, a table for item data, and so on. So, with tables, you organize and structure the data of your solution.

  1. Add a new Table and Page Designation containing three fields: Code, Description, and Disabled.
    Figure 1 - Creating and adding fields in Designation Table in Microsoft Dynamics Business Central/NAV
    Figure 1 - Creating and adding fields in Designation Table in Microsoft Dynamics Business Central/NAV
    Pages allow the user to interact with Business Central/NAV. Pages can be displayed on multiple display targets, like computers, tablets, and smart phones. A Page can be linked to a source table or not. If they are not linked to a source table, they are either Role Center pages or blank pages.
    Figure 2 - Creating and adding fields in designation page in Dynamics Business Central/NAV
    Figure 2 - Creating and adding fields in designation page in Dynamics Business Central/NAV
  2. Add a New Field in the Resource Table, Designation Code.
    The Table Extension object is used to extend existing tables in the Business Central application. You can add new fields but not delete or change existing fields. There are certain table properties that cannot be modified with a Table Extension (for example, the ID and Name of the table). You can create new secondary key but cannot modify the primary key.
    Figure 3 – Adding new field in the Resource table in Microsoft Dynamics Business Central/NAV
    Figure 3 – Adding new field in the Resource table in Microsoft Dynamics Business Central/NAV
  3. The Page Extension object is used to extend existing pages in the Business Central/NAV application. You can add, move, or hide existing fields.
    Figure 4 - Adding fields in the Resource Card in Microsoft Dynamics Business Central/NAV
    Figure 4 - Adding fields in the Resource Card in Microsoft Dynamics Business Central/NAV
  4. The user should be able to select a Designation Code in the Resource Card from the new Table.
    Figure 5 - Creating a Table Relation in Microsoft Dynamics Business Central/NAV
    Figure 5 - Creating a Table Relation in Microsoft Dynamics Business Central/NAV  
  5. When the user selects Resource in Sales Order Lines, the Designation Code selected in Resource Card should be available in Sales Order Lines Page. For this requirement, you need to create a table extension for adding the Designation Code Field in the Sales Line Table.
    Figure 6 - Adding a field in the Sales Line Table in Microsoft Dynamics Business Central/NAV
    Figure 6 - Adding a field in the Sales Line Table in Microsoft Dynamics Business Central/NAV
  6. Create a Page Extension for adding a Designation Code field in the Sales Line Table.
    Figure 7 - Adding a Field in the Sales Order sub form in Dynamics 365 Business Central on premises
    Figure 7 - Adding a Field in the Sales Order sub form in Dynamics 365 Business Central on premises
    A Code Unit is a container for AL code that you can use in many application objects. Typing the shortcut “tcodeunit” will create the basic layout for a Code Unit object when using the AL Language extension in Visual Studio Code.
    Figure 8 - Creating a Code Unit for the Sales Line Table in Microsoft Dynamics Business Central/NAV
    Figure 8 - Creating a Code Unit for the Sales Line Table in Microsoft Dynamics Business Central/NAV
  7. If the user increases the Quantity in a Sales Order line to more than 20, the Designation Code should set to Blank.
    Figure 9 – Creating one more event subscriber In the same Codeunit in Microsoft Dynamics Business Central/NAV
    Figure 9 – Creating one more event subscriber In the same Codeunit in Microsoft Dynamics Business Central/NAV
  8. The user should also be able to select the Designation Code in the Sales Order Lines Page. This requirement is satisfied in Figure 10.
    Figure 10 - Creating a table relation for the Sales Line and Designation Table in Microsoft Dynamics Business Central/NAV
    Figure 10 - Creating a table relation for the Sales Line and Designation Table in Microsoft Dynamics Business Central/NAV

If you have any questions about Dynamics NAV or Business Central for any version, 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 Development Blogs.

     

    Blog Tags: 
    Read ArcherPoint's Blog Follow us on Twitter Follow us on Facebook Follow us on LinkedIn Link to our RSS feed Watch us on YouTube
    Get Help Now