GetWORunOnALine Method
- Last UpdatedNov 06, 2025
- 4 minute read
'Declaration
Public Shared Function GetWORunOnALine( _
ByVal lineId As Integer, _
ByVal filterType As LineFilterType, _
ByVal filterDuration As Nullable(Of Integer), _
ByVal filterTimeUnit As LineFilterTimeUnit, _
ByVal filterStartOffset As Nullable(Of Integer), _
ByVal filterEndOffset As Nullable(Of Integer) _
) As DataSet
'Usage
Dim lineId As Integer
Dim filterType As LineFilterType
Dim filterDuration As Nullable(Of Integer)
Dim filterTimeUnit As LineFilterTimeUnit
Dim filterStartOffset As Nullable(Of Integer)
Dim filterEndOffset As Nullable(Of Integer)
Dim value As DataSet
value = Line.GetWORunOnALine(lineId, filterType, filterDuration, filterTimeUnit, filterStartOffset, filterEndOffset)
public static DataSet GetWORunOnALine(
int lineId,
LineFilterType filterType,
Nullable<int> filterDuration,
LineFilterTimeUnit filterTimeUnit,
Nullable<int> filterStartOffset,
Nullable<int> filterEndOffset
)
Parameters
- lineId
- Required. Holds the ID of the line.
- filterType
- Required. Holds a LineFilterType enumeration value that specifies the type of time period by which to filter the data. For more information, see the LineFilterType enumeration help topic for the FactMES.API.Core namespace.
- filterDuration
- Optional. Holds an integer value that specifies the value of N if filterType is LastNHours.
- filterTimeUnit
Required. Holds a LineFilterTimeUnit enumeration value that specifies the time unit for a custom filter if filterType is Custom. For more information, see the LineFilterTimeUnit enumeration help topic for the FactMES.API.Core namespace.
If filterType is not Custom, this parameter is ignored.
- filterStartOffset
- Optional. Holds an integer that specifies the start point of the time interval for which the events are to be filtered. See the Remarks section below for more information about how this parameter is used.
- filterEndOffset
- Optional. Holds an integer that specifies the end point of the time interval for which the events are to be filtered. See the Remarks section below for more information about how this parameter is used.
Return Value
Returns a DataSet that contains the work orders that were run on a line during the specified period of time.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
wo_id |
A string that is the ID of the work order. |
|
item_id |
A string that is the ID of the item. |
|
item_desc |
A string that is the description of the item. |
|
item_display |
A string that is the display string for the item that is returned. The display string is based on the Item Display system attribute (attr_id = 210).
|
|
uom_description |
A string that is the description of the unit of measure, from the UOM table. |
|
uom_abbreviation |
A string that is the abbreviation of the unit of measure, from the UOM table. |
|
num_decimals |
An integer that is the number of decimals for formatting quantity values. |
|
starting_quantity |
A double that is the quantity of item that is expected to be produced if there are no scrap/waste/rejects, from the Job table. |
|
required_quantity |
A double that is the quantity of item required, from the Job table. |
|
remaining_quantity |
A double that is the quantity defined as the difference between the start quantity and the sum of the quantity produced and the quantity rejected (qty_start - (qty_prod + quantity rejected)). |
|
period_produced |
A double that is the amount of good production made on the production entities of the line during the specified time period, in terms of the UOM of the line's standard item if defined. From the Job table. |
|
total_produced |
A double that is the total amount of good production made on the production entities of the line, in terms of the UOM of the line's standard item if defined. From the Job table. |
|
period_rejected |
A double that is the amount of rejected production made on the entities upstream from and including the production entities of the line during the specified time period, in terms of the UOM of the line's standard item if defined. From the Job table. |
|
total_rejected |
A double that is the total amount of rejected production made on the entities upstream from and including the production entities of the line, in terms of the UOM of the line's standard item if defined. From the Job table. |
|
wo_status |
An integer that represents the status code 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's status. |
|
wo_status_color |
An integer that represents the color of the work order's status. |
The filter_start_offset and the filter_end_offset together define an interval that filters the data to be returned (that is, only data that falls within the interval will be returned). These offsets both go backwards from the current time; a value of 1 indicates the current time, a value of 2 indicates one time unit ago, etc.
The filter_start_offset must be greater (that is, further back in time) than the filter_end_offset. If the filter_end_offset is 0, it is ignored (that is, the end of the interval will be the current time). For example, if filter_time_unit is set to 2 (Day), filter_start_offset is set to 2, and filter_end_offset is set to 1, then only the data with an event time that occurred yesterday will be returned. If filter_time_unit is set to 1 (Shift), filter_start_offset is set to 1, and filter_end_offset is set to 0, then only the events that occurred during the current shift will be returned.
Note: Because this method queries historical tables and supports custom time periods, use caution when querying large time periods (greater than a day), as system performance can be adversely affected.