GetByKey Method (WO)
- Last UpdatedNov 06, 2025
- 5 minute read
The GetByKey() method retrieves the specified work order record from the WO table.
Parameters
- woId
- Required. Holds the ID of the work order that is being retrieved.
Return Value
Returns a DataSet that contains the DataRow of the specified work order. If no matching record for the specified work order is found, an empty DataSet is returned. Column values are from the WO table unless otherwise indicated.
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. |
| 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. |
| 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. |
| 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. |
| 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 |
| 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. |