GetInventory(String,String,Nullable<Boolean>,String,Nullable<DateTime>) Method
- Last UpdatedNov 06, 2025
- 5 minute read
The GetInventory() method retrieves a list of items from an entity's inventory.
For this overload of the method, the entity is identified by its entity name and site name.
'Declaration
Public Overloads Shared Function GetInventory( _
ByVal entName As String, _
ByVal siteName As String, _
ByVal includeMovableEntities As Nullable(Of Boolean), _
ByVal lastEditBy As String, _
ByVal lastEditAt As Nullable(Of Date) _
) As DataSet
'Usage
Dim entName As String
Dim siteName As String
Dim includeMovableEntities As Nullable(Of Boolean)
Dim lastEditBy As String
Dim lastEditAt As Nullable(Of Date)
Dim value As DataSet
value = StorageExec.GetInventory(entName, siteName, includeMovableEntities, lastEditBy, lastEditAt)
public static DataSet GetInventory(
string entName,
string siteName,
Nullable<bool> includeMovableEntities,
string lastEditBy,
Nullable<DateTime> lastEditAt
)
Parameters
- entName
- Required. Holds the name of the entity.
- siteName
- Optional. Holds the site name of the entity.
- includeMovableEntities
- Optional filter parameter. Holds a flag that specifies whether all the storage entities should be included.
- lastEditBy
- Optional filter parameter. Holds the user who added or last changed an item record.
- lastEditAt
- Optional filter parameter. Holds the date/time when an item record was added or last edited.
Return Value
Returns a DataSet that contains a record for each item that matches the supplied filter parameters. 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. |
|
ent_name |
A string that is unique entity name, from the ent.ent_name column. |
|
description |
A string that is the entity description, from the ent.description column. |
|
item_id |
A string that is the ID of the item identifier, from the Item_Inv table. |
|
item_desc |
A string that is item description, from the item.item_desc column. |
|
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. |
|
grade_cd |
An integer that is the grade code of the lot, from the Item_Inv table. |
|
item_grade_desc |
A string that is the unique item grade description, from the item_grade.item_grade_desc column. |
|
item_grade_color |
An integer that indicates the background color, from the item_grade.color column. |
|
status_cd |
An integer that is the status code of the lot, from the Item_Inv table. |
|
item_status_desc |
A string that is unique item status description, from the item_state.item_status_desc column. |
|
item_state_color |
An integer that is the item state background color, from the item_state.color column. |
|
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. |
|
uom_id |
An integer that is the unit of measurement for inventory, from the Item_Inv table. |
|
uom_description |
A string that is unique description of the unit, from the Item_Inv table. |
|
abbreviation |
A string that is the UOM abbreviation to append to quantities, from the uom.abbreviation column. |
|
date_in_utc |
A datetime that is the when, in UTC, an item was last received to this lot/location, from the Item_Inv table. |
|
date_in_local |
A datetime that is when, in local time, an item was last received to this lot/location, from the Item_Inv table. |
|
date_in |
A datetime that is when, in the client’s local time, an item was last received to this lot/location, from the Item_Inv table. |
|
date_out_utc |
A datetime that is the when, in UTC, an item was last sent from this lot/location, from the Item_Inv table. |
|
date_out_local |
A datetime that is when, in local time, an item was last sent from this lot/location, from the Item_Inv table. |
|
date_out |
A datetime that is when, in the client’s local time, an item was last sent from this lot/location, from the Item_Inv table. |
|
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. |
|
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. |
|
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. |
|
last_edit_comment |
A string that contains comments about why the record was changed. |
|
last_edit_by |
A string that is the ID of the user who added or last updated this record. |
|
last_edit_at |
A datetime that indicates when the record was added or last updated. |
|
row_id |
An integer that is the unique identifier of row, from the Item_Inv table. |
|
uom_desc |
A string that is the unique description of the UOM, from the uom.description column. |
|
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.
If the includeMovableEntities flag is set to false, then only the rows from the Item_Inv table for the matching supplied entId values are returned.
If the includeMovableEntities flag is set to true, then a storage entity list is generated with the supplied entId and all its descendent entities. That is, the storage_exec.storage_ent_id is recursed until each Storage_Exec record has no other storage_exec.ent_id records pointing to it as their storage_ent_id. The recursion is stopped when no further entities (i.e., the storage_exec.storage_ent_id is null) are found or the storage_exec.storage_ent_id is pointing back to the previous entity in the storage entity list. The final inventory DataSet includes only the entities that are generated by this storage entity list.