› Dynamics NAV › Creating Quality Group on Item Card using VS code in NAV 2017

Creating Quality Group on Item Card using VS code in NAV 2017

 Chris D'silva   Leave a comment

Introduction:

This article specifies how to add a group called ‘Quality’ in the Item Card Page using VS Code in NAV 2017. The requirement to add this group is to have all the quality related parameters for a particular item. Based on these parameters, when and what test needs to be done is decided. Quality play a very important role in case of a pharmaceutical company and these changes are done keeping in mind the pharmaceutical process.

This group contains the four fields.

QC Enabled Check box: The checkbox decides whether the quality test should be done or not on a particular item.

Retesting Period:  Retesting Period is the time span when the item will be tested again.

Spec ID: The Specification ID is a look up to the page called ‘Specification Page’ which contains a list of specification which helps in deciding what test needs to be done in testing.

WIP QC Enabled Checkbox:(Work In Progress) This checkbox is used to define the quality test should be done or not for a particular item, when that particular item is in WIP

WIP Spec ID: The WIP(Work In Progress) Specification ID is a look up to the page called ‘Specification Page’ which contains a list of specification which helps in deciding what test needs to be done in testing when the particular item is in WIP.

Prerequisites:

1. Visual studio Code (VS Code)
2. Microsoft Dynamics NAV Web client

Steps:

  1. A folder is created named ‘Quality extension’. All files with extension as .al are placed here. Firstly, we create a file named ‘Itemtabext.al’ then typing the shortcut ‘ttableext’ a layout for table extension is created. We add the fields here.

    Here the Spec ID and WIP Spec ID have a look up to the Specification Header table field Spec ID.

  2. We create a page extension typing the shortcut ‘tpageext’ which creates the layout for page extension.The ‘Quality Section’ group is added after the Warehouse group hence we use ‘addafter’ Here QC Enabled,Restesting Period and Spec ID are mandatory fields so we set the ‘ShowMandatory’ field to True.
  3. In the No. Series Page in the web client, we specify the default number series for Specifications and look up is assigned to Quality Control Set up Page
  4. An Action is created in the Item table for calling the Specification Page and Quality Control Setup.

    Here the Specification No is a look up to the No. Series Code created in Step 3.

    Here Spec ID is manually typed and the specification name is specified in the description.

  5. We need to create a new table ‘Specification Header’ table which contains a list of specification which helps in deciding what test needs to be done in testing.

    1. In the table Specification Header, we declare variables and specify a record ‘Quality Control Setup’ and Codeunit ‘No Series Management’.
    2. On the Insert trigger of the ‘Specification Header’ table we set the created date as the work date, created by as the UserID. We declare Quality Control setup record to fetch the default number series specified in the No. Series Page.

  6. The Quality control Set up table is created which has a table relation to the ‘No. Series’ table field code and page is created which is called in the Web client through an action
  7. We create a Codeunit to Test and Validate the field and send the Item for Sampling.
  8. We then create a navx package by building it using Ctrl+Shift+B which creates the app.json and to publish our extension we use the shortcut F5 which creates the launch.json file.

    Here we specify the Extension name and the publisher.

  9. In the Web client in the ‘Extension Management’ Page we can view our extension
  10. We browse to the ‘Item’ page to view our output.

Error faced in the previous Development preview

Spec ID in the Quality group is a look up to the Specification Page which contains a list of specification which helps in deciding what test needs to be done in testing. This look up wasn’t working in the previous development preview of NAV using VS Code, this was a bug on table relation/drill down property

https://github.com/Microsoft/AL/issues/39

Error resolved after the January development preview update

After the Development preview January update, the bug on the Table Relation Property was resolved. Below is a screenshot attached justifying the same.

Below is the screen shot of the Issues in the previous preview update which were solved in the January update.

 


Liked it? Share it.

Leave a Reply

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

Time limit is exhausted. Please reload the CAPTCHA.