---
title: "Events defined in Miscellaneous Management"
app: "Warehouse Insight"
section: "Developer"
last_updated: "2023-06-05"
url: "https://insight-works.com/kb/warehouse-insight/events-defined-in-miscellaneous-management/"
---

# Events defined in Miscellaneous Management

### Properties

| Property | Value |
| --- | --- |
| Object Type | Codeunit |
| Object Subtype | Normal |
| Object ID | 23044914 |
| Accessibility Level | Public |

### Events

#### OnBeforeGenerateSerialNumber()

 Note: Use OnBeforeGenerateSN() for Warehouse Insight 2.9.

OnBeforeGenerateSerialNumber event executes inside generateSerialNumber Procedure in Warehouse Insight’s Misc. Management Codeunit before the procedure generates a new serial number for an item by default. Developers can subscribe to this event to customize the process for creating a new serial number.

##### Syntax

```
OnBeforeGenerateSerialNumber(pcodItemNumber: Code[20], pcodVariantCode: Code[10], pcodSerialNumberOut: Code[50])
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodItemNumber_ | Code[20] | Code variable to identify the product with item number. |
| _pcodVariantCode_ | Code[10] | Code variable to identify the product with variant code. |
| _pcodSerialNumberOut_ | Code[50] | Code variable to store product serial number information. |

#### OnBeforeGenerateSN()

 Note: Use OnBeforeGenerateSN() for Warehouse Insight 2.9.

OnBeforeGenerateSN event executes inside generateSerialNumber Procedure in WHI Misc. Management Codeunit before the procedure generates a new serial number for an item by default. Developers can subscribe to this event to customize the process for creating a new serial number.

##### Syntax

```
OnBeforeGenerateSN(pcodItemNumber: Code[20], pcodVariantCode: Code[10], var pcodSerialNumberOut: Code[50])
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodItemNumber_ | Code[20] | Code variable to identify the product with item number. |
| _pcodVariantCode_ | Code[10] | Code variable to identify the product with variant code. |
| _pcodSerialNumberOut_ | Code[50] | Code variable to store product serial number information. |

#### `OnBeforeGenerateLotNumber()`

#### ``

 Note: Use OnBeforeGenerateLN() for Warehouse Insight 2.9.

OnBeforeGenerateLotNumber event executes inside generateLotNumber Procedure in Warehouse Insight’s Misc. Management Codeunit before the procedure generates a new lot number for an item by default. Developers can subscribe to this event to customize the process for creating a new lot number.

##### Syntax

```
OnBeforeGenerateLotNumber(pcodItemNumber: Code[20], pcodVariantCode: Code[10], pcodLotNumberOut: Code[50])
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodItemNumber_ | Code[20] | Code variable to identify the product with item number. |
| _pcodVariantCode_ | Code[10] | Code variable to identify the product with variant code. |
| _pcodLotNumberOut_ | Code[50] | Code variable to store product lot number information. |

#### `OnBeforeGenerateLN()`

#### ``

 Note: Use OnBeforeGenerateLN() for Warehouse Insight 2.9.

OnBeforeGenerateLN event executes inside generateLotNumber Procedure in Warehouse Insight’s Misc. Management Codeunit before the procedure generates a new lot number for an item by default. Developers can subscribe to this event to customize the process for creating a new lot number.

##### Syntax

```
OnBeforeGenerateLN(pcodItemNumber: Code[20], pcodVariantCode: Code[10], var pcodLotNumberOut: Code[50])
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodItemNumber_ | Code[20] | Code variable to identify the product with item number. |
| _pcodVariantCode_ | Code[10] | Code variable to identify the product with variant code. |
| _pcodLotNumberOut_ | Code[50] | Code variable to store product lot number information. |

#### OnBeforeGeneratePackageNumber()

#### ``

OnBeforeGeneratePackageNumber event executes inside GeneratePackageNumber Procedure in WHI Misc. Management Codeunit, before the procedure generates a new package number for an item by default. Developer can subscribe to this event to customize the process for creating a new package number.

##### Syntax

```
OnBeforeGeneratePackageNumber(var pcodItemNumber: Code[20], var pcodVariantCode: Code[10], var pcodPackageNumberOut: Code[50])
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodItemNumber_ | Code[20] | Code variable to identify the product with item number. |
| _pcodVariantCode_ | Code[10] | Code variable to identify the product with variant code. |
| _pcodPackageNumberOut_ | Code[50] | Code variable to store product serial number information. |

#### OnBeforeGetItemsForCache()

Use this event to subscribe to when the items are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemsForCache(var pdtLastFetchedOn: DateTime, var pcodLastItemNumber: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastItemNumber_ | Code[20] | The last item that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The xml output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetBinsForCache()`

Use this event to subscribe to when the bins are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetBinsForCache(pcodLocationCode: Code[10], var pdtLastFetchedOn: DateTime, var pcodLastBinCode: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodLocationCode_ | Code[10] | The Location the Bins are being fetched for. |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastBinCode_ | Code[20] | The last bin that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemReferencesForCache()`

Use this event to subscribe to when the item references are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemReferencesForCache(var pdtLastFetchedOn: DateTime, var pcodLastItemNumber: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastItemNumber_ | Code[20] | The last item that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemCrossReferencesForCache()`

Use this event to subscribe to when the item cross references are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemCrossReferencesForCache(var pdtLastFetchedOn: DateTime, var pcodLastItemNumber: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastItemNumber_ | Code[20] | The last item that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemIdentifiersForCache()`

Use this event to subscribe to when the item identifiers are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemIdentifiersForCache(var pdtLastFetchedOn: DateTime, var pcodLastCode: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records this will remain static. |
| _pcodLastCode_ | Code[20] | The last item identifier that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemLedgerEntriesForCache()`

Use this event to subscribe to when the item ledger entries are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemLedgerEntriesForCache(var pdtLastFetchedOn: DateTime, var piLastEntryNumber: integer, var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _piLastEntryNumber_ | Integer | The last item item ledger entry that was fetched. This will be less than one if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemUnitsOfMeasureForCache()`

Use this event to subscribe to when the item units of measure are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemUnitsOfMeasureForCache(var pdtLastFetchedOn: DateTime, var pcodLastItemNumber: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastItemNumber_ | Code[20] | The last item that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetBarcodeRulesForCache()`

Use this event to subscribe to when the barcode rules are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetBarcodeRulesForCache(var pdtLastFetchedOn: DateTime, var piLastRuleID: integer, var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _piLastRuleID_ | integer | The last barcode rule that was fetched. This will be less than one if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnBeforeGetItemPicturesForCache()`

Use this event to subscribe to when the item pictures are fetched from the server for caching on the device.

##### Syntax

```
OnBeforeGetItemPicturesForCache(var pdtLastFetchedOn: DateTime, var pcodLastItemNumber: Code[20], var piFetchSize: Integer, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pdtLastFetchedOn_ | DateTime | The datetime (UTC) that the device last requested a fetch for. While the system is fetching additional records, this will remain static. |
| _pcodLastItemNumber_ | Code[20] | The last item that was fetched. This will be blank if the last request resulted in less than that “fetch\_size” being returned. |
| _piFetchSize_ | Integer | The number of records to return in this call. |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The XML output. Must match expected format of device. |
| _pbHandled_ | Boolean | Set to True to prevent the base code from executing. Set to False if the base code should continue. |

#### `OnAterGetDeviceConfigValues()`

##### Syntax

```
OnAterGetDeviceConfigValues(var precDeviceConfig: Record "WHI Device Configuration", var pdnOutput: TextBuilder)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _precDeviceConfig_ | Record “WHI Device Configuration” |  |
| _pdnOutput_ | TextBuilder | The output text to return to the device. |

#### `OnBeforeDecodeItemBarcode()`

##### Syntax

```
OnBeforeDecodeItemBarcode(var pcodLocationCode: Code[10], var psBarcode: Text, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, var pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodLocationCode_ | Code[10] |  |
| _psBarcode_ | Text |  |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The output text to return back to the device. |
| _pbHandled_ | Boolean | Set to true if the procedure has been handled. False if the base code should continue to execute. |

#### `OnBeforeDecodeBinBarcode()`

##### Syntax

```
OnBeforeDecodeBinBarcode(var pcodLocationCode: Code[10], var psBarcode: Text, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, var pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodLocationCode_ | Code[10] |  |
| _psBarcode_ | Text |  |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The output text to return back to the device. |
| _pbHandled_ | Boolean | Set to true if the procedure has been handled. False if the base code should continue to execute. |

#### `OnBeforeDecodePackageBarcode()`

##### Syntax

```
OnBeforeDecodePackageBarcode(var pcodLocationCode: Code[10], var psBarcode: Text, var ptrecEventParams: Record "IWX Event Param" temporary, var pbsOutput: BigText, var pbHandled: Boolean)
```

##### Parameters

#### ``

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| _pcodLocationCode_ | Code[10] |  |
| _psBarcode_ | Text |  |
| _ptrecEventParams_ | Record “IWX Event Param” | The variables (key/value pairs) being supplied to the procedure. |
| _pbsOutput_ | BigText | The output text to return back to the device. |
| _pbHandled_ | Boolean | Set to true if the procedure has been handled. False if the base code should continue to execute. |
