5 Jan’17

D365 Business CentralSteps to create Table Extension Object and Page Extension Object Using Visual Studio Code in NAV

Introduction:

Table Extension and Page Extension are two new objects introduced in the Microsoft Dynamics NAV TENERIFE Developer Preview (Visual Studio Code) release. Table Extension allows to add more fields to an existing table and to change properties of certain fields of a table. Page Extension object allows to add additional fields and actions to an existing page and extends Dynamics NAV page object.

This article will provide the basic steps to create a Table extension object and Page extension object using Visual Studio Code in NAV.

Prerequisite:

1. Visual Studio Code
2. Microsoft Dynamics NAV TENERIFE (Developer Preview)

Purpose:

To create a table extension object and page extension object using Visual Studio Code in NAV. To demonstrate this, I will be adding an additional field on Item card.

Steps:

  1. Create a new folder for a new project.
  2. Fig 1: New Folder created for the Project
  3. Open this folder in Visual Studio Code
  4. Create a new file within this folder in Visual Studio Code
  5. Fig 2: Create a new file in the newly created folder
  6. Let’s name this file ‘ItemTableExt.al’
  7. Typing the shortcut ‘ttableext’ will create the basic layout for a table extension.

    Fig 3: Shortcut ttableext

    Fig 4: Basic layout of a table extension

    Replace ‘id’ with a unique table id. It should be in the range from ‘70000000’ to ‘74999999’. Replace ‘MyExtension’ with a unique name of the table extension and ‘MyTargetTable’ with the name of the table where these additional fields have to be added.

    This is shown in the below Screenshot.

    After entering the ‘MyTargetTable’ name, Press ‘Ctrl+Shift+B’ to build the solution which will create app.json file.

  8. Here, I will be creating a Decimal Field ‘Control Sample Qty’. To create a table field, type the shortcut ‘tfield’.
  9. Fig 5: Basic layout of a table field
  10. Replace ‘id’ with a unique field id. Replace ‘MyField’ with a unique field name and mention the type of the field viz. Decimal, Integer, etc. Mention the properties of the field below.

    Fig 6: New field ‘Control Sample Qty’ with ID ‘70000000’ of type ‘Decimal’ is added to ‘Item table’ which is highlighted in red colour. Property of this field i.e. ‘Editable=False’ is highlighted in lime colour.

    Hence the table extension has been created.

  11. To create a page extension, create a new file. Let’s name this file as ItemPageExt.al.
  12. Type the shortcut ‘tpageext’ to create a basic layout of a page extension.

    Fig 7: Basic layout of a page extension.

    In the layout section, you can use the following functions to place page fields and groups on the page. Similarly, in the actions section, you use these functions to place actions in the ribbon. (Note: General and AddressDetails are group names)

    1. addfirst(General) – Applies to Groups only
    2. addlast(General) – Applies to Groups only
    3. addafter(AddressDetails) – Applies to Fields and groups
    4. addbefore(AddressDetails) – Applies to Fields and groups
    5. movefirst(General) – Applies to Groups only
    6. movelast(General) – Applies to Groups only
    7. moveafter(AddressDetails) – Applies to Fields and groups
    8. movebefore(AddressDetails) – Applies to Fields and groups
  13. Replace id with a unique page extension id in the range from ‘70000000’ to ‘74999999’. Replace ‘MyExtension’ with the name of the page extension. Replace ‘MyTargetPage’ with the name of the existing page in which additional functionality has to be added.
  14. The following page extension extends Item card and adds field ‘Control Sample Qty’ to the ‘InventoryGrp’.

    Fig 8: Field is added to the page using Page extension

    Hence, page extension is created.

  15. Build the solution using ‘Ctrl+Shift+B’.

    Hence ‘navx file’ will be created.

  16. Press F5 to create launch.json file or manually create launch.json file. Thus launch.json will be created.

    Fig: launch.json
  17. In the NAV Web client, in Extensions Management, the published extension will be displayed.

    Fig 9: Extensions Management

    Thus, the newly created field i.e. ‘Control Sample Qty’ will be displayed in Item card.

    Fig 10: New field ‘Control Sample Qty’ field has been added to Item card.

    Conclusion:

    Thus, Table extension is used when additional fields are to be added to an existing table or any properties of the fields have to be changed and Page extension is used to add additional functionality to existing pages like extra fields and actions.

     

    Written by

    Team Member

    CloudFronts

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • How to create Dynamics 365 Finance & Operations (formerly Dynamics AX) connection in SSIS

    12 December’ 2019

    Introduction: Creating a Connection is one of the first Steps during the integration of data. While performing Integrati...

    Read more
  • How to create AX (D365 F&0) Connection in SSIS

    12 December’ 2019

    Introduction: Creating a Connection is one of the first Steps during integration of data. While performing Integration w...

    Read more
  • First cut review of new D365 Project Service

    12 December’ 2019

    The new Project Service coming up is a much-advanced version of PSA. Even more, than it will be called as Project Servic...

    Read more
  • Business Central Wave 2 Features – Section 4

    11 December’ 2019

    Introduction: In this blog, I will be attempting to provide information about the new Modern Client features of Business...

    Read more
  • Business Central Wave 2 Features – Section 5

    11 December’ 2019

    Introduction: In this blog, I will be attempting to provide information about the new Modern Client features of Business...

    Read more

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close