CloneWO Method
- Last UpdatedNov 06, 2025
- 2 minute read
The CloneWO() method clones an existing work order and all its instance-specific data.
'Declaration
Public Shared Sub CloneWO( _
ByVal sessionId As Integer, _
ByVal newWoId As String, _
ByVal existingwoId As String, _
ByVal userId As String, _
ByVal reqQty As Nullable(Of Double), _
ByVal woDesc As String, _
ByVal releaseTime As Nullable(Of Date), _
ByVal reqFinishTime As Nullable(Of Date), _
ByVal woPriority As Nullable(Of Integer), _
ByVal custInfo As String, _
ByVal moId As String, _
ByVal notes As String _
)
'Usage
Dim sessionId As Integer
Dim newWoId As String
Dim existingwoId As String
Dim userId As String
Dim reqQty As Nullable(Of Double)
Dim woDesc As String
Dim releaseTime As Nullable(Of Date)
Dim reqFinishTime As Nullable(Of Date)
Dim woPriority As Nullable(Of Integer)
Dim custInfo As String
Dim moId As String
Dim notes As String
JobExec.CloneWO(sessionId, newWoId, existingwoId, userId, reqQty, woDesc, releaseTime, reqFinishTime, woPriority, custInfo, moId, notes)
public static void CloneWO(
int sessionId,
string newWoId,
string existingwoId,
string userId,
Nullable<double> reqQty,
string woDesc,
Nullable<DateTime> releaseTime,
Nullable<DateTime> reqFinishTime,
Nullable<int> woPriority,
string custInfo,
string moId,
string notes
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the work order is being cloned.
- newWoId
- Required. Holds the ID of the new work order.
- existingwoId
- Required. Holds the ID of the work order that is being cloned.
- userId
- Required. Holds the ID of the user who is cloning the work order.
- reqQty
- Optional. Holds the quantity of the final item to be made. Default is the req_qty value of the cloned work order.
- woDesc
- Optional. Holds the description of the new work order. Default is the new work order ID.
- releaseTime
- Optional. Holds the release time of the new work order. Default is the current date and time.
- reqFinishTime
- Optional. Holds the required finish time of the new work order. Default is the current date and time + 24 hours.
- woPriority
- Optional. Holds the priority of the new work order and all its jobs. Default is the priority value of the cloned work order.
- custInfo
- Optional. Holds the customer information. The default is an empty string.
- moId
- Optional. Holds the ID of the manufacturing order.
- notes
- Optional. Holds notes about the new work order. The default is an empty string.
This method clones all the data from the existing specified work order to a new work order. If any data exists in the following tables for the existing work order, it will be cloned to the new work order: Wo, Wo_Attr, Wo_File, Job, Data_Entry_Sched, Job_Bom, Job_Step, Job_Link, Job_Spec, Job_Attr, Data_Log_Grp_Job_Link, and Job_Bom_Subst.