Sample Quantity Dialog Extensions
This article will describe the process of extending the Quantity dialog in Warehouse Insight to capture additional information.
In this solution below we will be creating an Quantity Extension to capture three additional pieces of information during the Receiving process:
- Date of Manufacture
- Vendor Lot Number
- QA Inspection Result
Creating the Quantity Extension Header
Open the Quantity Extensions page in NAV (Departments -> Warehouse Insight -> Setup -> Quantity Extensions).
- Create a new Quantity Extension called “QA_INSPECTION”
- Give the extension a suitable description
- Set the “New Page” value to “No”
- This will add the additional fields to the quantity dialog. Setting to “Yes” will prompt the user for values in a separate dialog after the quantity dialog closes.
- Leave the “Page Title” blank (only required if using a new page for the additional fields)
Creating the Quantity Extension Fields
Create fields/questions for each of the data pieces that we will be collecting.
- Create a field to prompt the user for the Date of Manufacture
- Field Name: DateOfMfg
- Field Caption: Date of Manufacture
- Data Type: Date
- Validation Event ID: 2000000
- Create a field to prompt the user for the Vendor Lot Number
- Field Name: VendorLotNo
- Field Caption: Vendor Lot No.
- Data Type: String
- Create a field to prompt the user for the Inspection Result
- Field Name: InspectionResult
- Field Caption: Inspection Result
- Data Type: Option
- Default Event ID: 2000001
Associating the Extension to an Application
- Open the Scan Behaviors page in NAV (Departments -> Warehouse Insight -> Setup -> Scan Behaviors)
- Specify the “QA_INSPECTION” for the “WHSE_RECEIPT_DOC” scan behavior
Note: It is possible to have different extensions for the same module by making multiple scan behaviors. For example by item tracking code.
Create a Codeunit to Process the Default and Validation Events
Default Value event handlers must return a standard ‘%1’ result.
Validation events handlers will get the fields value sent in the field name key of the Event Params record.
An example of the required functions are:
The extension codeunit used has also been attached to this article for reference.
Note: The first value in the option string default values will be the selected option.
Testing the Quantity Extension
When the quantity dialog is displayed on the device you should see the additional three controls, like so:
Validations will fire when the value is changed and when the “OK” button is pressed to close the dialog.
All additional fields will be sent to the processing event as per normal for further handling.