---
title: "Sample Quantity Dialog Extensions"
app: "Warehouse Insight"
section: "Developer"
last_updated: "2024-09-04"
url: "https://insight-works.com/kb/warehouse-insight/sample-quantity-dialog-extensions/"
---

# 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

###

### Create the Quantity Extension Header and Fields

1. Navigate to the _Warehouse Insight Quantity Extensions_ page in Business Central.
2. Create a new Quantity Extension and modify the following fields:

   - Code: QA\_INSPECTION
   - Description: Input the description (e.g., Additional fields for receiving).
   - New Page: No (adds the additional fields to the quantity dialog. Setting to Yes prompts the user for values in a separate dialog.)
   - Page Title: (blank; only required if using a new page for the additional fields.)
3. Create fields/questions for each of the data pieces you are collecting:

1.

| **Field Name** | **Field Caption** | **Data Type** | **Default Event ID** | **Validation Event ID** |
| --- | --- | --- | --- | --- |
| DateOfMfg | Date of Manufacture | Date | – | 2000000 |
| VendorLotNo | Vendor Lot No. | String | – | – |
| InspectionResult | Inspection Result | Option | 2000001 | – |

###

### Associate the Extension with an Application

1. Open the _Scan Behaviors_ page in Business Central.
2. Locate the WHSE\_RECEIPT\_DOC line and input “QA\_INSPECTION” in the _Quantity Extension Code_ field.
3. Close the _Scan Behaviors_ page.

 Note: You can have different extensions for the same module by creating multiple scan behaviors (e.g., by item tracking code).

### Create a Codeunit to Process the Default and Validation Events

Default Value event handlers must return a standard value result. Option values are a comma-separated list, where the first item in the list is the selected value.

Validation events handlers send the fields value in the field name key of the Event Params record.An example of the required functions are:![Validate MFG Date](/wp-content/uploads/kb-legacy/Sample-Quantity-Dialog-Extensions-codeunit.png) You can also download the extension codeunit [here](/wp-content/uploads/kb-legacy/quantity-extension-codeunit-1.zip).

 Note: The first value in the option string default values will be the selected option.

###

### Test the Quantity Extension

When the quantity dialog is displayed on the device you should see the additional three controls, like so:

![Quantity Dialog](/wp-content/uploads/kb-legacy/unnamed.png)

Validations fire when you change the value and select the **OK** to close the dialog.All additional fields are sent to the processing event, as per normal, for further handling.
