GetByFilter(String,String,String,String,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,Nullable<Boolean>,Nullable<Int32>,Nullable<Double>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,Nullable<Int32>,Nullable<Double>,Nullable<Boolean>,String,String,Nullable<Double>,String,String,Nullable<Int32>,Nullable<Double>,Nullable<Double>,Nullable<Double>,Nullable<Boolean>,String,String,String,String,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 8 minute read
The GetByFilter() overload method retrieves the top N item records from the Item table, as specified by the filter parameters. Passing no filter parameters will retrieve all the item records from the table.
'Declaration
Public Overloads Shared Function GetByFilter( _
ByVal itemId As String, _
ByVal itemDesc As String, _
ByVal itemClassId As String, _
ByVal itemClassDesc As String, _
ByVal produced As Nullable(Of Boolean), _
ByVal consumed As Nullable(Of Boolean), _
ByVal itemClassObsolete As Nullable(Of Boolean), _
ByVal uomId As Nullable(Of Integer), _
ByVal template As Nullable(Of Boolean), _
ByVal lifetime As Nullable(Of Integer), _
ByVal unitCost As Nullable(Of Double), _
ByVal obsolete As Nullable(Of Boolean), _
ByVal purchased As Nullable(Of Boolean), _
ByVal sold As Nullable(Of Boolean), _
ByVal numberOfDecimals As Nullable(Of Integer), _
ByVal mustCompleteSteps As Nullable(Of Boolean), _
ByVal mustProdReqdQty As Nullable(Of Boolean), _
ByVal minGrade As Nullable(Of Integer), _
ByVal minState As Nullable(Of Integer), _
ByVal minInvLevel As Nullable(Of Double), _
ByVal autoReorder As Nullable(Of Boolean), _
ByVal lotNoFormat As String, _
ByVal lastLotNo As String, _
ByVal maxLotSize As Nullable(Of Double), _
ByVal subLotNoFormat As String, _
ByVal lastSubLotNo As String, _
ByVal serialNoLevel As Nullable(Of Integer), _
ByVal maxSubLotSize As Nullable(Of Double), _
ByVal maxOrderSize As Nullable(Of Double), _
ByVal minTraceInv As Nullable(Of Double), _
ByVal invUniqueByJob As Nullable(Of Boolean), _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal maxRows As Nullable(Of Integer) _
) As DataSet
'Usage
Dim itemId As String
Dim itemDesc As String
Dim itemClassId As String
Dim itemClassDesc As String
Dim produced As Nullable(Of Boolean)
Dim consumed As Nullable(Of Boolean)
Dim itemClassObsolete As Nullable(Of Boolean)
Dim uomId As Nullable(Of Integer)
Dim template As Nullable(Of Boolean)
Dim lifetime As Nullable(Of Integer)
Dim unitCost As Nullable(Of Double)
Dim obsolete As Nullable(Of Boolean)
Dim purchased As Nullable(Of Boolean)
Dim sold As Nullable(Of Boolean)
Dim numberOfDecimals As Nullable(Of Integer)
Dim mustCompleteSteps As Nullable(Of Boolean)
Dim mustProdReqdQty As Nullable(Of Boolean)
Dim minGrade As Nullable(Of Integer)
Dim minState As Nullable(Of Integer)
Dim minInvLevel As Nullable(Of Double)
Dim autoReorder As Nullable(Of Boolean)
Dim lotNoFormat As String
Dim lastLotNo As String
Dim maxLotSize As Nullable(Of Double)
Dim subLotNoFormat As String
Dim lastSubLotNo As String
Dim serialNoLevel As Nullable(Of Integer)
Dim maxSubLotSize As Nullable(Of Double)
Dim maxOrderSize As Nullable(Of Double)
Dim minTraceInv As Nullable(Of Double)
Dim invUniqueByJob As Nullable(Of Boolean)
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim maxRows As Nullable(Of Integer)
Dim value As DataSet
value = Item.GetByFilter(itemId, itemDesc, itemClassId, itemClassDesc, produced, consumed, itemClassObsolete, uomId, template, lifetime, unitCost, obsolete, purchased, sold, numberOfDecimals, mustCompleteSteps, mustProdReqdQty, minGrade, minState, minInvLevel, autoReorder, lotNoFormat, lastLotNo, maxLotSize, subLotNoFormat, lastSubLotNo, serialNoLevel, maxSubLotSize, maxOrderSize, minTraceInv, invUniqueByJob, spare1, spare2, spare3, spare4, maxRows)
public static DataSet GetByFilter(
string itemId,
string itemDesc,
string itemClassId,
string itemClassDesc,
Nullable<bool> produced,
Nullable<bool> consumed,
Nullable<bool> itemClassObsolete,
Nullable<int> uomId,
Nullable<bool> template,
Nullable<int> lifetime,
Nullable<double> unitCost,
Nullable<bool> obsolete,
Nullable<bool> purchased,
Nullable<bool> sold,
Nullable<int> numberOfDecimals,
Nullable<bool> mustCompleteSteps,
Nullable<bool> mustProdReqdQty,
Nullable<int> minGrade,
Nullable<int> minState,
Nullable<double> minInvLevel,
Nullable<bool> autoReorder,
string lotNoFormat,
string lastLotNo,
Nullable<double> maxLotSize,
string subLotNoFormat,
string lastSubLotNo,
Nullable<int> serialNoLevel,
Nullable<double> maxSubLotSize,
Nullable<double> maxOrderSize,
Nullable<double> minTraceInv,
Nullable<bool> invUniqueByJob,
string spare1,
string spare2,
string spare3,
string spare4,
Nullable<int> maxRows
)
Parameters
- itemId
- Optional filter parameter. Holds the ID of an item.
- itemDesc
- Optional filter parameter. Holds the description of an item.
- itemClassId
- Optional filter parameter. Holds the ID of an item class.
- itemClassDesc
- Optional filter parameter. Holds the description of an item class.
- produced
- Optional filter parameter. Holds a flag that specifies whether the returned DataSet should include only items that are part of a class that can produce items.
- consumed
- Optional filter parameter. Holds a flag that specifies whether the returned DataSet should include only items that are part of a class that can consume items.
- itemClassObsolete
- Optional filter parameter. Holds a flag that specifies whether the returned DataSet should include items that are part of a class specified as obsolete. If set to true, then items of both obsolete and non-obsolete classes are included in the DataSet. If set to false or null, only items that are of non-obsolete classes are included in the DataSet.
- uomId
- Optional filter parameter. Holds the ID of an item unit of measure.
- template
- Optional filter parameter. Holds a flag that indicates whether the item is a template to be copied and not an actual item.
- lifetime
- Optional filter parameter. Holds the number of days that is the lifetime of an item, from manufacture to expiry.
- unitCost
- Optional filter parameter. Holds the unit cost of an item.
- obsolete
- Optional filter parameter. Holds a flag that specifies whether the returned DataSet should include obsolete items. If set to true, then items that are both obsolete and not obsolete are included in the DataSet. If set to false or null, only items that are not obsolete are included in the DataSet.
- purchased
- Optional filter parameter. Holds a flag that specifies whether an item is purchased.
- sold
- Optional filter parameter. Holds a flag that specifies whether an item is sold.
- numberOfDecimals
- Required. Holds the number of decimal places to use when specifying a quantity of the item.
- mustCompleteSteps
- Optional filter parameter. Holds a flag that specifies whether an item can complete steps.
- mustProdReqdQty
- Optional filter parameter. Holds a flag that specifies whether an item can produce the required quantity.
- minGrade
- Optional filter parameter. Holds the lowest shippable grade.
- minState
- Optional filter parameter. Holds the lowest shippable state.
- minInvLevel
- Optional filter parameter. Holds the overall amount of an item in the inventory below which a replenishment order should be generated.
- autoReorder
- Optional filter parameter. Holds a flag that specifies whether the replenishment order be generated automatically.
- lotNoFormat
- Optional filter parameter. Holds the format of the lot number.
- lastLotNo
- Optional filter parameter. Holds the last lot number that was used for an item.
- maxLotSize
- Optional filter parameter. Holds an item's maximum lot size.
- subLotNoFormat
- Optional filter parameter. Holds the format of the sublot number.
- lastSubLotNo
- Optional filter parameter. Holds the last sublot number that was used for an item.
- serialNoLevel
- Optional filter parameter. Holds a value that determines what level represents a serial number for this item: < 0, not a serialized item 0, lot number > 0, sublot number.
- maxSubLotSize
- Optional filter parameter. Holds an item's maximum sublot size.
- maxOrderSize
- Optional. Holds the maximum quantity that can be specified in a work order for the item.
- minTraceInv
- Optional filter parameter. Holds the minimum traceable inventory for an item.
- invUniqueByJob
- Optional filter parameter. Holds a flag that specifies whether an item's inventory is unique by job.
- spare1
- Optional filter parameter. Holds the contents of the user-defined spare1 field.
- spare2
- Optional filter parameter. Holds the contents of the user-defined spare2 field.
- spare3
- Optional filter parameter. Holds the contents of the user-defined spare3 field.
- spare4
- Optional filter parameter. Holds the contents of the user-defined spare4 field.
- maxRows
- Optional filter parameter. Holds the value that determines how many records need to returned. field.
Return Value
Returns a DataSet that contains the top N records in the Item table that satisfy the specified filters. If no matching records are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
item_id |
ID of the item |
|---|---|
|
item_desc |
A string that is the description of the item. |
|
item_display |
A string that is formatted as specified by attr_id=210 |
|
item_class_id |
A string that is the ID of the class to which the item belongs. |
|
item_class_desc |
A string that is the description of the class to which the item belongs. |
|
item_class_display |
A string that is formatted as specified by attr_id=208 |
|
uom_id |
An integer that is the ID of the unit of measure (UOM) for this item is returned. |
|
template |
A Boolean that is a flag that indicates whether this item is a template or an actual item. |
|
lifetime |
An ineger that is the amount of time that the item is viable. |
|
unit_cost |
A floating value that is the cost of acquisition per unit for this item. |
|
obsolete |
A Boolean that is a flag that indicates whether this item is obsolete. |
|
purchased |
A Boolean that is a flag that indicates whether this item can be purchased. |
|
sold |
A Boolean that is a flag that indicates whether this item can be sold. |
|
num_decimals |
An integer that is the number of decimal places that is used for this item. |
|
must_complete_steps |
A Boolean that is a flag that indicates whether all steps must be completed/bypassed to end a job, regardless of the Job_Exec setting, when producing this item. |
|
must_prod_reqd_qty |
A Boolean that is a flag that indicates whether the quantity produced must be at least equal to the qty_reqd to end the job, regardless of Job_Exec setting, when producing this item. |
|
min_grade |
An integer that is the lowest grade considered shippable. |
|
min_state |
An integer that is the lowest state considered shippable. |
|
min_inv_level |
A floating point number that is the overall amount of this item in inventory, which when reached indicates that a replenishment order should be generated. |
|
reorder_amt |
A floating point number that is the minimum quantity of the replenishment order. |
|
auto_reorder |
A Boolean that is a flag that indicates whether the replenishment order should be generated automatically. |
|
lot_no_format |
A string that is the default lot number format for this item. |
|
last_lot_no |
A string that is the last assigned lot number to any of its items. |
|
max_lot_size |
A floating point number that is the maximum size of the lot of this item, in uom units. |
|
sublot_no_format |
A string that is the default sublot_no format for this item. |
|
last_sublot_no |
A string that is the last assigned sublot_no to any of its items. |
|
serial_no_lvl |
An integer that is the serial number level. Ie 0 if lot_no is the serial number,> 0 if a particular sublot level is the serial number, and -1 (default) if there are no serial numbers. |
|
max_sublot_size |
A floating point number that is the maximum size of the sublot of this item in UOM units. |
|
max_order_size |
A floating point number that is the largest starting quantity for a work order for this item. |
|
min_trace_inv |
A floating point number that is the minimum amount of inventory of a particular lot that will be maintained in a storage entity for which the indistinguishable_lots flag is true. Lesser amounts will be merged into another lot of the same item in the same location. |
|
inv_unique_by_job |
A Boolean that is a flag that indicates whether storing items in the inventory should be tied with a job. |
|
notes |
A Boolean that is a flag that indicates whether storing items in the inventory should be tied with a job. |
|
spare1 |
A string that is the contents of the user-defined spare1 field. |
|
spare2 |
A string that is the contents of the user-defined spare2 field. |
|
spare3 |
A string that is the contents of the user-defined spare3 field. |
|
spare4 |
A string that is the contents of the user-defined spare4 field. |
|
last_edit_comment |
A string that contains comments about why the record was added or updated. |
|
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. |