GetByFilter(String,String,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Nullable<Int32>,Nullable<Int32>,Boolean) Method
- Last UpdatedNov 06, 2025
- 8 minute read
The GetByFilter() method retrieves the work order records from the WO table, as specified by the filter parameters. Passing null as the work order ID, null as the item ID, and false for running, ready, onhold, suspended, new, and complete will retrieve all work order records from the table.
This overload of the method includes the includeWorkOrdersFromProcess parameter.
'Declaration
Public Overloads Shared Function GetByFilter( _
ByVal woId As String, _
ByVal itemId As String, _
ByVal newState As Boolean, _
ByVal readyState As Boolean, _
ByVal runningState As Boolean, _
ByVal completeState As Boolean, _
ByVal suspendedState As Boolean, _
ByVal onHoldState As Boolean, _
ByVal targetSchedLineId As Nullable(Of Integer), _
ByVal numberOfWorkOrders As Nullable(Of Integer), _
ByVal includeWorkOrdersFromProcess As Boolean _
) As DataSet
'Usage
Dim woId As String
Dim itemId As String
Dim newState As Boolean
Dim readyState As Boolean
Dim runningState As Boolean
Dim completeState As Boolean
Dim suspendedState As Boolean
Dim onHoldState As Boolean
Dim targetSchedLineId As Nullable(Of Integer)
Dim numberOfWorkOrders As Nullable(Of Integer)
Dim includeWorkOrdersFromProcess As Boolean
Dim value As DataSet
value = WO.GetByFilter(woId, itemId, newState, readyState, runningState, completeState, suspendedState, onHoldState, targetSchedLineId, numberOfWorkOrders, includeWorkOrdersFromProcess)
public static DataSet GetByFilter(
string woId,
string itemId,
bool newState,
bool readyState,
bool runningState,
bool completeState,
bool suspendedState,
bool onHoldState,
Nullable<int> targetSchedLineId,
Nullable<int> numberOfWorkOrders,
bool includeWorkOrdersFromProcess
)
Parameters
- woId
- Optional filter parameter. Holds the ID of the work order to be retrieved.
- itemId
- Optional filter parameter. Holds the ID of an item for the work order.
- newState
- Required filter parameter. Holds a flag that indicates whether the work order's state is new.
- readyState
- Required filter parameter. Holds a flag that indicates whether the work order's state is ready.
- runningState
- Required filter parameter. Holds a flag that indicates whether the work order's state is running.
- completeState
- Required filter parameter. Holds a flag that indicates whether the work order's state is complete.
- suspendedState
- Required filter parameter. Holds a flag that indicates whether the work order's state is suspended.
- onHoldState
- Required filter parameter. Holds a flag that indicates whether the work order's state is onhold.
- targetSchedLineId
Optional filter parameter. Holds a value that specifies work orders based on their line assignment, according to the following rules:
- If 0 or greater, returns only the work orders that have been assigned to the line whose ID is specified by the provided value. Note that 0 is a valid line ID.
- If -1, does not filter on the line assignment field of the WO table.
- If null, returns all work orders that have not been assigned to a line.
- numberOfWorkOrders
- Optional parameter. Holds an integer value that indicates the maximum number of work order records to be returned. The most recently created work orders (that is, those with the greatest row_id column values) are returned.
- includeWorkOrdersFromProcess
- Required. Holds a flag that indicates whether work orders that were created from processes should be returned in the DataSet. If the flag is set to false, the DataSet will not contain work orders that were created from processes. If the flag is set to true, the DataSet will contain work orders created from processes.
Return Value
Returns a DataSet that contains records for all the work orders that satisfy the specified filters. Column values are from the WO table unless otherwise indicated. If no matching work orders are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
| Column Name | Description |
|---|---|
| wo_id | A string that is the work order ID. |
| wo_desc | A string that is the work order description. |
| process_id | A string that is the ID of the process from which the work order was created, if the work order was created from a process. |
| process_desc | A string that is the description of the process from which the work order was created, if the work order was created from a process. From the Process table. |
| bom_ver_id | A string that is the BOM version of the original item that this work order produces specified at the time it was created, unless created on-the-fly. |
| spec_ver_id | A string that is the specification version selected for all operations (if any) at the time the work order was created, unless created on-the-fly. |
| item_id | A string that is the ID of the final item being made, unless all its jobs are disassembly jobs, in which case this is the initial item. |
| item_desc | A string that is the item description. From the Item table. |
| serial_no_lvl |
An integer that is an enumeration that indicates how the serial number of the item being produced for the work order is determined. 0 = the lot number is the serial number. 1 or greater = the sublot level that is the serial number. -1 = serial numbers are not used (the default). From the Item table. |
| uom_id | An integer that is the ID of the unit of measure for the item being produced for the work order. From the Item table. |
| uom_desc | A string that is the description of the unit of measure for the item being produced for the work order. From the UOM table. |
| num_decimals | An integer that is the number of decimal places to use for quantities of the item. From the Item table. |
| num_decimals_good_pp | If num_decimals is 0, an integer that is the value of the system attribute Max decimals of good piece part entries (attr_id 326 in the System_Attr table), which is used to determine the number of decimal places to use for quantities of good item production. |
| req_qty | A double that is the required quantity of items to be produced for the work order. |
| release_time_utc | A datetime that indicates when the work order was or will be released, in UTC. |
| release_time_local | A datetime that indicates when the work order was or will be released, in the local time of the entity that is the production source for the item being produced for the work order. |
| release_time | A datetime value that indicates when the work order was or will be released, in the local time of the client application that is making the call. |
| req_finish_time_utc | A datetime value that indicates when the work order must be completed, in UTC. |
| req_finish_time_local | A datetime value that indicates when the work order must be completed, in the local time of the entity that is the production source for the item being produced for the work order. |
| req_finish_time | A datetime value that indicates when the work order must be completed, in the local time of the client application that is making the call. |
| state_cd |
An integer that is the code that indicates the state of the work order. 0 = Released (default). 1 = Started. 2 = Completed. 3 = Closed. When closed, nothing else for this work order is editable. |
| wo_priority | An integer that is the work order priority. This is used as the default priority for jobs in the work order. |
| cust_info | A string that is the customer information for the work order. |
| mo_id | A string that is the manufacturing order, for grouping different final parts. |
| production_schedule_id | A string that is the production schedule to which the work order (Production Request ID) belongs. |
| notes | A string that is the notes about the work order. |
| not_deletable | A Boolean that is a flag that indicates whether the work order can be deleted. |
| disassembly | A Boolean that is a flag that indicates whether the work order is disassembling something. |
| may_override_route | A Boolean that is a flag that indicates whether the work order can include operations other than those immediately upstream or downstream from the current one. |
| override_serialization | A Boolean that is a flag that indicates whether an item that the work order is producing and that is normally treated as serialized is not treated as serialized. |
| input_wo_id | A string that is the work order ID of the job from which a rework work order originates. |
| input_oper_id | A string that is the operation ID of the job from which a rework work order originates. |
| input_seq_no | An integer that is the operation sequence number of the job from which a rework work order originates. |
| target_sched_line_id | An integer that is the ID of the production line to which the work order is assigned. This will be null if the work order is not assigned to a line. |
| target_sched_line_name | A string that is the name of the production line to which the work order is assigned. This will be null if the work order is not assigned to a line. From the Line table. |
| queue_seq_no | An integer that is the sequence number of the work order in the queue. |
| wo_status |
An integer that is the code that indicates the status of the work order. 1 = New 2 = Ready 3 = Running (in progress) 4 = Complete 5 = Suspended 6 = On Hold |
| wo_status_desc | A string that is the description of the work order status (e.g., New). |
| color | An integer that indicates the background color for the work order status when displayed in the user interface. |
| qty_reqd | A double that is the required quantity of items to be produced for the work order. |
| qty_at_start | A double that is the quantity of items that the work order is expected to produce if there is no rejected production (that is, if all production is good). If the work order is assigned to a line, this quantity is based on the jobs performed at the entities identified as the production source for the line. |
| qty_prod | A double that is the good quantity produced. |
| qty_rejected | A double that is the quantity rejected. |
| qty_remaining | A double that is the item quantity defined as the difference between the start quantity and the sum of the quantity produced and the quantity rejected (qty_at_start - (qty_prod + qty_rejected)). |
| def_reqd_qty | A double that is original required quantity less the good quantity produced in any job for this work order that runs on a line's production source entities, or 0, whichever is greater. |
| spare1 | A string that is the contents of the work order’s user-defined spare1 field. |
| spare2 | A string that is the contents of the work order’s user-defined spare2 field. |
| spare3 | A string that is the contents of the work order’s user-defined spare3 field. |
| spare4 | A string that is the contents of the work order’s user-defined spare4 field. |
| last_edit_comment | A string that is the comments about why record was added or last 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 specifies when the record was added or last updated. |
| mod_id | A string that is the current modification ID of the record in the WO table. This ID is binary number that increments each time the record’s table row is modified. Optionally used for optimistic concurrency control when performing updates or deletes. |
| calc_start_qty | A string that is the sum of items that the work order can optimally produce given the raw material available based on the jobs that are run on a line's production source entities. |
| calc_reqd_qty | A string that is the sum of items that the work order is required to produce given the raw material available based on the jobs that are run on a line's production source entities. |
| row_num |
An integer that is the number of the work orders returned in the dataset. Row numbers correspond to the creation time order of the work orders, with the lowest number being the most recent work order. If a calling client application has set a maximum number of work orders that can be returned (for performance reasons), the row numbers can be used to ensure that the most recent work orders are returned if the maximum number is exceeded. |
| row_id | An integer that is the unique row ID of the record in the WO table. |