SplitJob(Int32,String,String,Int32,String,Double,Nullable<Double>,Nullable<Int32>,Nullable<DateTime>,Nullable<Int32>,String,Int32) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The SplitJob() method splits a job into two jobs.
This overload of the method uses the entity ID to specify the entity.
'Declaration
Public Overloads Shared Sub SplitJob( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal origSeqNo As Integer, _
ByVal userId As String, _
ByVal splitQty As Double, _
ByVal splitStartQty As Nullable(Of Double), _
ByVal newStateCd As Nullable(Of Integer), _
ByVal reqFinishTime As Nullable(Of Date), _
ByVal targetEntId As Nullable(Of Integer), _
ByVal statusNotes As String, _
ByRef newSeqNo As Integer _
)
'Usage
Dim sessionId As Integer
Dim woId As String
Dim operId As String
Dim origSeqNo As Integer
Dim userId As String
Dim splitQty As Double
Dim splitStartQty As Nullable(Of Double)
Dim newStateCd As Nullable(Of Integer)
Dim reqFinishTime As Nullable(Of Date)
Dim targetEntId As Nullable(Of Integer)
Dim statusNotes As String
Dim newSeqNo As Integer
JobExec.SplitJob(sessionId, woId, operId, origSeqNo, userId, splitQty, splitStartQty, newStateCd, reqFinishTime, targetEntId, statusNotes, newSeqNo)
public static void SplitJob(
int sessionId,
string woId,
string operId,
int origSeqNo,
string userId,
double splitQty,
Nullable<double> splitStartQty,
Nullable<int> newStateCd,
Nullable<DateTime> reqFinishTime,
Nullable<int> targetEntId,
string statusNotes,
out int newSeqNo
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the job is being split.
- woId
- Required. Holds the work order ID of the job.
- operId
- Required. Holds the operation ID of the job.
- origSeqNo
- Required. Holds the sequence number of the job from which the split is being made.
- userId
- Required. Holds the ID of the user who is creating the work order.
- splitQty
- Required. Holds the quantity of the job to be split to the new job.
- splitStartQty
- Optional. Holds the start quantity of the job to be split to the new job. Default is null.
- newStateCd
Optional. Holds the code of the initial state of the new job. Only the following values are allowable: 1 (New), 2 (Ready), 5 (Suspended), or 6 (Onhold).
If not defined or the supplied code is invalid, then the default is the state of the current job, or the default is 2 (Ready) if the current job is either 3 (Running), 4 (Complete), or 7 (Cancelled).
- reqFinishTime
- Optional. Holds the required finish time of the new job. The default is the date/time of the current job.
- targetEntId
- Optional. Holds the ID the entity on which the new job is targeted to run. Default is the target_ent_id for the current job.
- statusNotes
- Optional. Holds status about the new jobs. Default is “Created by Job Split”.
- newSeqNo
- Output. Holds the returned sequence number of the new job. Defaults to the lowest unused sequence number for the given work order and operation.
This method allows the quantity required for a job to be split into two jobs so that parts of it can be run on different machines.
The wo_id and oper_id (operation) are retained; only a different seq_no is created for the new row in the Job table. The split_qty must be less than remaining quantity to be produced (req_qty – qty_prod) of the existing job, as the qty_reqd of the original job will be reduced by this amount.
For the method to succeed, the user ID must be valid and have sufficient privileges to split jobs.
The optional parameters can be used to set certain values in the new job that might be different than the original. If they are not specified, then the column values from the original job are used with the following exceptions:
run_ent_id = null
sched_pinned = false
qty_prod = 0
qty_prod_erp = null
qty_rejected = 0
qty_ rejected_erp = null
concurrent_link = 0
act_start_time = null
act_finish_time = null
sched_start_time = null
sched_finish_time = null
All rows in the following tables will also be cloned: Job_Bom, Job_Bom_Step, Job_Spec, Job_Step, Job_Route, and Job_Attr, with the following exceptions:
job_spec.act_spec_value is set = null
job_spec.act_time is set = null
job_spec.complete is set = 0