GetInv(String,String,String) Method
- Last UpdatedNov 06, 2025
- 6 minute read
The GetInv() method retrieves inventory records, filtered by a specified entity and/or inventory parameters.
For this overload of the method, the optional entity filter is identified by its entity name and site name.
'Declaration
Public Overloads Shared Function GetInv( _
ByVal entName As String, _
ByVal siteName As String, _
ByVal invFilter As String _
) As DataSet
'Usage
Dim entName As String
Dim siteName As String
Dim invFilter As String
Dim value As DataSet
value = StorageExec.GetInv(entName, siteName, invFilter)
Parameters
- entName
- Optional filter parameter. Holds the name of an entity whose inventory records are to be retrieved.
- siteName
- Optional filter parameter. Holds the site name of an entity whose inventory records are to be retrieved.
- invFilter
Optional filter parameter. Holds a string that includes several inventory filter criteria. See Remarks for the available filter criteria.
Return Value
Returns a DataSet that contains a record for each inventory that matches the supplied filter parameters. The inventory records contain columns from the Item_Inv, Item_State, Item, Item_Class, and Uom tables, and some attribute columns from the Inv_Item_Attr, Inv_Lot_Attr tables. If no matching records are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
ent_id |
An integer that is the ID of the entity, from the Ent table. |
|
item_id |
A string that is the ID of the item identifier, from the Item_Inv table. |
|
description |
A string that is the entity description, from the Ent table. |
|
item_desc |
A string that is item description, from the Item table. |
|
item_display |
A string that is a value that indicates what format to use when identifying the item in the user interface. The format values are defined in the system attribute Item display (attr_id 210 in the System_Attr table).
|
|
lot_no |
A string that is the lot number, from the Item_Inv table. |
|
sublot_no |
A string that is sublot number, from the Item_Inv table. |
|
row_id_h |
An integer that is the unique identifier of the row, from the Item_Inv table. |
|
qty_left |
A double that is the quantity left, from the Item_Inv table. |
|
qty_left_erp |
A double that is the quantity left that has already been reported to the ERP system, from the Item_Inv table. |
|
date_in_utc |
A datetime that is the UTC time when an item was last received to this lot/location, from the Item_Inv table. |
|
date_in_local |
A datetime that is the local time when an item was last received to this lot/location, from the Item_Inv table. |
|
date_in |
A datetime that is the client's local time when time, an item was last received to this lot/location, from the Item_Inv table. |
|
date_out_utc |
A datetime that is that is the UTC time when item was last sent from this lot/location, from the Item_Inv table. |
|
date_out_local |
A datetime that is that is the local time when an item was last sent from this lot/location, from the Item_Inv table. |
|
date_out |
A datetime that is that is the client's local time when an item was last sent from this lot/location, from the Item_Inv table. |
|
last_edit_at_h |
A datetime that is when the record was created or last modified. |
|
expiry_date_utc |
A datetime that is the expiry date and time for the item in UTC, from the Item_Inv table. |
|
expiry_date_local |
A datetime that is the expiry date and time for the item in the local time of the entity at which the inventory event occurred, from the Item_Inv table. |
|
expiry_date |
A datetime that is the expiry date and time for the item in the local time of the client application that is making the call, converted from the expiry_date_utc value. |
|
item_grade_cd |
A string that is the item grade code, from the Item_Inv table. |
|
item_grade_desc |
A string that is the item grade description, from the Item_Grade table. |
|
gradecolor_h |
An integer that indicates the RGB value of the item grade's color in the user interface, from the Item_Grade table. |
|
item_status_cd |
An integer that is the item state code, from the Item_Inv table. |
|
item_status_desc |
A string that is the item state description, from the Item_State table. |
|
statuscolor_h |
An integer that indicates the RGB value of the item state's color in the user interface, from the Item_State table. |
|
ent_name |
A string that is the unique entity name, from the Ent table. |
|
loc_status |
An integer that indicates the status value, from the Storage_Exec table. For example, it returns 0 for Available, 1 for Used, 2 for Dirty. |
|
uom_id_h |
An integer that is the ID of the unit of measurement for the item, from the Item table. |
|
inv_unique_by_job_h |
A Boolean that indicates whether the item is unique by job based on the work order, operation, and sequence number, from the Item table. |
|
wo_id |
A string that is the ID of the work order, from the Item_Inv table. |
|
oper_id |
A string that is operation ID, from the Item_Inv table. |
|
seq_no |
An integer that is the operation sequence number, from the Item_Inv table. |
|
num_decimals_h |
An integer that is the number of decimal places for a quantity, from the Item table. |
|
units |
A string that is the description of the item UOM identified in the uom_id_h column, from the UOM table. |
|
item_class_id |
A string that is the item class identifier, from the Item_Class table. |
|
item_class_desc |
A string that is the description of the item class, from the Item_Class table. |
|
item_class_display |
A string that is a value that indicates what format to use when identifying the item class in the user interface. The format values are defined in the system attribute Item class display (attr_id 208 in the System_Attr table).
|
|
item_inv_uom_id |
An integer that is the ID of the UOM for inventory if the inventory UOM is non-null in this inventory record. Otherwise, it is the ID of the UOM for the item in this record. From the Item_Inv table. |
|
item_inv_uom_description |
A string that is the description of the UOM for inventory if the inventory UOM is non-null in this inventory record. Otherwise, it is the description of the UOM for the item in this record. From the UOM table. |
|
spare1 |
A string that is the contents of the user-defined spare1 field, from the Item_Inv table. |
|
spare2 |
A string that is the contents of the user-defined spare2 field, from the Item_Inv table. |
|
spare3 |
A string that is the contents of the user-defined spare3 field, from the Item_Inv table. |
|
spare4 |
A string that is the contents of the user-defined spare4 field, from the Item_Inv table. |
|
spare5 |
A string that is the contents of the user-defined spare5 field, from the Item_Inv table. |
|
spare6 |
A string that is the contents of the user-defined spare6 field, from the Item_Inv table. |
|
inv_item_item_id_h |
A string that identifies the item whose attributes are to be included in the returned array for display in the inventory grid, from the inv_item_item_id_h column of the Inv_Item_Attr table. |
|
inv_lot_item_id_h |
A string that identifies the item of the lot whose attributes are to be included in the returned array for display in the inventory grid, from the inv_lot_item_id_h column of the Inv_Lot_Attr table. |
|
inv_lot_lot_no_h |
A string that identifies the number of the lot whose attributes are to be included in the returned array for display in the inventory grid, from the inv_lot_lot_no_h column of the Inv_Lot_Attr table. |
| attrn |
A string that is the value of an item or lot attribute that has been assigned to the inventory, where n is the attribute ID. This column is included only if the visible_in_inventory flag of the item or lot attribute's record in the Attr table is set to true. This flag corresponds to the attribute's In Inventory Grid option in MES Client. |
| attrnd_h |
A string that is the name of an item or lot attribute that has been assigned to the inventory, where n is the attribute ID. This column is included only if the visible_in_inventory flag of the item or lot attribute's record in the Attr table is set to true. This flag corresponds to the attribute's In Inventory Grid option in MES Client. |
For input parameters that are not to be included as a filter, pass a null.
The following sample invFilter parameter string indicates the string format and the available filter criteria.
$ent_name=$$item_id=$$item_desc=$$item_class_id=$$item_class_desc=$
$lot_no=$$sublot_no=$$grade_cd=$$status_cd=$$expiry_date_from_utc=$$expiry_date_utc=$$wo_id=$
- Each filter criterion is enclosed by the delimiters '$'.
- The value for each filter criterion follows the equal sign.
- The filter parameters that take strings or integers can be partial entries using the % wildcard character. (for example, $wo_id=2019.01%$) to match any work order beginning with 2019.01.
- The expiry_date_from_utc filter parameter is evaluated as => (equal to or greater than). Dates that are equal to or later than the entered date would match.
- The expiry_date_utc filter parameter is evaluated as <= (less than or equal to). Dates that are prior or equal to the entered date would match.
- The expiry_date_from_utc and expiry_date_utc parameters can be used together to specify a date range.
Example Filter String
The following filter string would return inventory for any entity beginning with Roaster and expired in January 2019.
$ent_name=Roaster%$$item_id=$$item_desc=$$item_class_id=$$item_class_desc=$
$lot_no=$$sublot_no=$$grade_cd=$$status_cd=$
$expiry_date_from_utc=1//1//2019 12:00:00 AM$$expiry_date_utc=1//31//2019 11:50:59 PM$$wo_id=$