GetInventoryByFilter(Int32,String,String,Nullable<Int32>,Nullable<Boolean>,String) Method
- Last UpdatedNov 06, 2025
- 5 minute read
The GetInventoryByFilter() method retrieves inventory information for the specified entity or a movable entity that is located at that entity.
For this overload of the method, the entity is identified by its entity name and site name.
'Declaration
Public Overloads Shared Function GetInventoryByFilter( _
ByVal sessionId As Integer, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal restrictToEnt As Nullable(Of Integer), _
ByVal currentInventory As Nullable(Of Boolean), _
ByVal filter As String _
) As DataSet
'Usage
Dim sessionId As Integer
Dim entName As String
Dim siteName As String
Dim restrictToEnt As Nullable(Of Integer)
Dim currentInventory As Nullable(Of Boolean)
Dim filter As String
Dim value As DataSet
value = StorageExec.GetInventoryByFilter(sessionId, entName, siteName, restrictToEnt, currentInventory, filter)
public static DataSet GetInventoryByFilter(
int sessionId,
string entName,
string siteName,
Nullable<int> restrictToEnt,
Nullable<bool> currentInventory,
string filter
)
Parameters
- sessionId
- Optional. Holds the session ID and thus the user who is making this method call.
- entName
- Required. Holds the name of the entity.
- siteName
- Required. Holds the site name of the entity.
- restrictToEnt
- Optional filter parameter. Holds an integer that acts as a flag that, if set to true, specifies that only information about the specified entity should be retrieved, and not about any movable entities located at that entity.
- currentInventory
- Optional filter parameter. Holds an integer that acts as a flag that, if set to true and a wo_id and oper_id are supplied in the filter, specifies that only information for that work order and operation will be retrieved.
- filter
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 |
|---|---|
|
row_id |
An integer that is the unique identifier of the row, from the Item_Inv table. |
|
ent_id |
An integer that is the ID of the entity, from the Item_Inv table. |
|
item_id |
A string that is the ID of the item identifier, from the Item_Inv 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. |
|
grade_cd |
An integer that is the grade code of the lot, from the Item_Inv table |
|
status_cd |
An integer that is the status code of the lot, from the Item_State table. |
|
ent_name |
A string that is the unique entity name, from the ent.ent_name column. |
|
located_at_ent_id |
An integer that is the Default/Preferred parent entity ID, from the ent.parent_ent_id column. |
|
located_at_ent_name |
A string that is the parent entity name, from the ent.ent_name column. |
|
item_desc |
A string that is the item description, from the item.item_desc column. |
|
item_uom_id |
An integer that is the ID of the unit of measurement (UOM) for the item, from the item.uom_id column. |
|
inv_unique_by_job_h |
A Boolean that is a flag that indicates whether item_inv records for this item include wo_id, oper_id, and seq_no in their effective PK, from the item.inv_unique_by_job column. |
|
item_grade_desc |
A string that is the unique item grade description, from the item_grade.item_grade_desc column. |
|
grade_color |
An integer that indicates the background color, from the item_grade.color column. |
|
item_status_desc |
A string that is the unique item status description, from the Item_State table. |
|
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 ID of the unit of measurement for inventory, 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_in_local |
A datetime in local time that when an item was last received to this lot/location, from the Item_Inv table. |
|
date_in_utc |
A datetime in UTC that is when an item was last received to 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. |
|
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_utc |
A datetime that is the when, in UTC, an item was last sent from this lot/location, 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 expiry_date_utc. |
|
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_utc |
A datetime that is the expiry date and time for the item in UTC, from the Item_Inv 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 |
An integer that is the number of decimal places for a quantity, from the item.num_decimals column. |
|
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. |
|
uom_desc |
A string that is the unique description of the UOM, from the uom.description column. |
|
item_class_id |
A string that is Item class identifier, from the item_class.item_class_id column. |
|
item_class_desc |
A string that is description of the item class, from the item_class.item_class_desc 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.
The following sample filter parameter string indicates the string format and the available filter criteria. Each filter criterion is enclosed by the delimiters '$'.
$item_id=$$item_desc=$$item_class_id=$$item_class_desc=$
$lot_no=$$grade_cd=$$status_cd=$$expiry_date_utc=$$wo_id=$
$oper_id=$$seq_no=$$serial_no=$$serialized_items=$
The value for each filter criterion follows the equal sign.