Add Method (WO)
- Last UpdatedNov 06, 2025
- 4 minute read
The Add() method adds a new work order record to the WO table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal woDesc As DBString, _
ByVal processId As DBString, _
ByVal bomVerId As DBString, _
ByVal specVerId As DBString, _
ByVal itemId As String, _
ByVal reqqty As Double, _
ByVal releaseTimeLocal As DBDateTime, _
ByVal reqFinishTimeLocal As DBDateTime, _
ByVal stateCd As Integer, _
ByVal woPriority As DBInt, _
ByVal custInfo As DBString, _
ByVal moId As DBString, _
ByVal notes As DBString, _
ByVal notDeletable As Boolean, _
ByVal disassembly As Boolean, _
ByVal mayOverrideRoute As Boolean, _
ByVal overrideSerialization As Boolean, _
ByVal inputWOId As DBString, _
ByVal inputOperId As DBString, _
ByVal inputSeqNo As DBInt, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef modId As String _
)
'Usage
Dim sessionId As Integer
Dim woId As String
Dim woDesc As DBString
Dim processId As DBString
Dim bomVerId As DBString
Dim specVerId As DBString
Dim itemId As String
Dim reqqty As Double
Dim releaseTimeLocal As DBDateTime
Dim reqFinishTimeLocal As DBDateTime
Dim stateCd As Integer
Dim woPriority As DBInt
Dim custInfo As DBString
Dim moId As DBString
Dim notes As DBString
Dim notDeletable As Boolean
Dim disassembly As Boolean
Dim mayOverrideRoute As Boolean
Dim overrideSerialization As Boolean
Dim inputWOId As DBString
Dim inputOperId As DBString
Dim inputSeqNo As DBInt
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim modId As String
WO.Add(sessionId, woId, woDesc, processId, bomVerId, specVerId, itemId, reqqty, releaseTimeLocal, reqFinishTimeLocal, stateCd, woPriority, custInfo, moId, notes, notDeletable, disassembly, mayOverrideRoute, overrideSerialization, inputWOId, inputOperId, inputSeqNo, spare1, spare2, spare3, spare4, lastEditComment, modId)
public static void Add(
int sessionId,
string woId,
DBString woDesc,
DBString processId,
DBString bomVerId,
DBString specVerId,
string itemId,
double reqqty,
DBDateTime releaseTimeLocal,
DBDateTime reqFinishTimeLocal,
int stateCd,
DBInt woPriority,
DBString custInfo,
DBString moId,
DBString notes,
bool notDeletable,
bool disassembly,
bool mayOverrideRoute,
bool overrideSerialization,
DBString inputWOId,
DBString inputOperId,
DBInt inputSeqNo,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
out string modId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- woId
- Required. Holds the ID of the work order that is being added.
- woDesc
- Optional. Holds the work order description.
- processId
Optional. Holds the ID of the process from which the work order was generated, if the work order was generated from a process.
- bomVerId
- Optional. Holds the work order's BOM version ID.
- specVerId
- Optional. Holds the work order's specification version ID.
- itemId
- Required. Holds the ID of the item for the work order.
- reqqty
- Required. Holds the required item quantity.
- releaseTimeLocal
- Optional. Holds the entity's local date/time when the work order will be released.
- reqFinishTimeLocal
- Optional. Holds the entity's local date/time by when the work order must be completed.
- stateCd
Required. Holds the code that indicates the state of the work order. Valid codes are:
0 = Released (the default)
1 = Started
2 = Completed
3 = Closed. When closed, nothing else for this work order is editable.
- woPriority
- Optional. Holds an integer that identifies the priority for the work order.
- custInfo
- Optional. Holds the work order's customer information.
- moId
- Optional. Holds the manufacturing order for the work order.
- notes
- Optional. Holds notes about the work order.
- notDeletable
- Required. Holds a flag that, if set to true, specifies that the work order cannot be deleted.
- disassembly
- Required. Holds a flag that, if set to true, indicates that the work order is disassembling something.
- mayOverrideRoute
- Required. Holds a flag that, if set to true, indicates that the work order can include operations other than those immediately upstream or downstream from the current one.
- overrideSerialization
- Required. Holds a flag that, if set to true, indicates that if the work order is producing an item that is normally serialized, the item is treated as not serialized.
- inputWOId
- Optional. Holds the work order ID of the job from which a rework work order would originate. Set to null if the work order is not created as a result of rework.
- inputOperId
- Optional. Holds the operation ID of the job from which a rework work order would originate. Set to null if the work order is not created as a result of rework.
- inputSeqNo
- Optional. Holds the operation sequence number of the job from which a rework work order would originate. Set to null if the work order is not created as a result of rework.
- spare1
- Optional. Holds the contents of the user-defined spare1 field.
- spare2
- Optional. Holds the contents of the user-defined spare2 field.
- spare3
- Optional. Holds the contents of the user-defined spare3 field.
- spare4
- Optional. Holds the contents of the user-defined spare4 field.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- modId
- Output. Holds the modification ID assigned to this record when it is added, for optimistic concurrency control. The modId parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
Observe the following input parameter rules:
- Required non-DB* parameters: Must pass a value. Cannot be empty or null.
- Optional non-DB* parameters: Either enter a value or pass a null. If passing a null and a default value has been defined, the default value will be used for the parameter.
- Required DB* parameters: Must pass a value. To enter an empty value for the parameter, pass DB*.null (e.g., DBInt.null).
- Optional DB* parameters: To enter no value for the parameter, pass DB*.null (e.g., DBInt.null). To use the default value for the parameter if one has been defined for the object being added, pass a null.