Add(Int32,String,String,Int32,DBString,String,JobStateCode,Nullable<Int32>,DBDateTime,Int32,Int32,DBInt,Double,Nullable<Double>,DBDouble,Nullable<Double>,DBDouble,Double,Nullable<Double>,Nullable<Double>,Nullable<Double>,Nullable<Boolean>,Nullable<Boolean>,DBDouble,DBDouble,DBDouble,DBDouble,Double,ProdUnitOfMeasure,DBDouble,DBDateTime,DBDateTime,DBDateTime,DBDateTime,DBDateTime,Nullable<Int32>,DBDouble,Nullable<Boolean>,Nullable<Boolean>,DBString,DBString,DBString,DBString,Int32,DBString,Nullable<Boolean>,DBString,DBString,DBString,DBString,DBString,DBString,DBString,Nullable<Boolean>,DateTime) Method
- Last UpdatedNov 06, 2025
- 7 minute read
The Add() method adds a new job record to the Job table.
This method adds a new job to an existing Work Order. For creating a brand new data entry job, see JobExec.StartDataEntryJob. For creating a brand new work order from process, see JobExec.CreateWOFromProcess.
This overload of the method requires the stateCd parameter, passed as a JobStateCode enumeration, and the prodUom parameter, passed as a ProdUnitOfMeasure enumeration.
'Declaration
Public Overloads Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal jobDesc As DBString, _
ByVal itemId As String, _
ByVal stateCd As JobStateCode, _
ByVal jobPriority As Nullable(Of Integer), _
ByVal reqFinishTimeLocal As DBDateTime, _
ByVal initSchedEntId As Integer, _
ByVal targetSchedEntId As Integer, _
ByVal runEntId As DBInt, _
ByVal qtyReqd As Double, _
ByVal qtyProd As Nullable(Of Double), _
ByVal qtyProdErp As DBDouble, _
ByVal qtyRejected As Nullable(Of Double), _
ByVal qtyRejectedErp As DBDouble, _
ByVal qtyAtStart As Double, _
ByVal deviationAbove As Nullable(Of Double), _
ByVal deviationBelow As Nullable(Of Double), _
ByVal batchSize As Nullable(Of Double), _
ByVal schedPinned As Nullable(Of Boolean), _
ByVal checkInv As Nullable(Of Boolean), _
ByVal estFixedLab As DBDouble, _
ByVal estLabRate As DBDouble, _
ByVal estSetupTime As DBDouble, _
ByVal estTeardownTime As DBDouble, _
ByVal estProdRate As Double, _
ByVal prodUom As ProdUnitOfMeasure, _
ByVal estTransferTime As DBDouble, _
ByVal schedStartTimeLocal As DBDateTime, _
ByVal latestStartTimeLocal As DBDateTime, _
ByVal schedFinishTimeLocal As DBDateTime, _
ByVal actStartTimeLocal As DBDateTime, _
ByVal actFinishTimeLocal As DBDateTime, _
ByVal concurrentLink As Nullable(Of Integer), _
ByVal jobCost As DBDouble, _
ByVal parentContingentJob As Nullable(Of Boolean), _
ByVal childContingentJob As Nullable(Of Boolean), _
ByVal notes As DBString, _
ByVal assocFile As DBString, _
ByVal assocFileType As DBString, _
ByVal statusNotes As DBString, _
ByVal displaySeq As Integer, _
ByVal folderVerId As DBString, _
ByVal rework As Nullable(Of Boolean), _
ByVal reworkCd As DBString, _
ByVal reworkProcessId As DBString, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByVal createJobBom As Nullable(Of Boolean), _
ByRef editTime As Date _
)
'Usage
Dim sessionId As Integer
Dim woId As String
Dim operId As String
Dim seqNo As Integer
Dim jobDesc As DBString
Dim itemId As String
Dim stateCd As JobStateCode
Dim jobPriority As Nullable(Of Integer)
Dim reqFinishTimeLocal As DBDateTime
Dim initSchedEntId As Integer
Dim targetSchedEntId As Integer
Dim runEntId As DBInt
Dim qtyReqd As Double
Dim qtyProd As Nullable(Of Double)
Dim qtyProdErp As DBDouble
Dim qtyRejected As Nullable(Of Double)
Dim qtyRejectedErp As DBDouble
Dim qtyAtStart As Double
Dim deviationAbove As Nullable(Of Double)
Dim deviationBelow As Nullable(Of Double)
Dim batchSize As Nullable(Of Double)
Dim schedPinned As Nullable(Of Boolean)
Dim checkInv As Nullable(Of Boolean)
Dim estFixedLab As DBDouble
Dim estLabRate As DBDouble
Dim estSetupTime As DBDouble
Dim estTeardownTime As DBDouble
Dim estProdRate As Double
Dim prodUom As ProdUnitOfMeasure
Dim estTransferTime As DBDouble
Dim schedStartTimeLocal As DBDateTime
Dim latestStartTimeLocal As DBDateTime
Dim schedFinishTimeLocal As DBDateTime
Dim actStartTimeLocal As DBDateTime
Dim actFinishTimeLocal As DBDateTime
Dim concurrentLink As Nullable(Of Integer)
Dim jobCost As DBDouble
Dim parentContingentJob As Nullable(Of Boolean)
Dim childContingentJob As Nullable(Of Boolean)
Dim notes As DBString
Dim assocFile As DBString
Dim assocFileType As DBString
Dim statusNotes As DBString
Dim displaySeq As Integer
Dim folderVerId As DBString
Dim rework As Nullable(Of Boolean)
Dim reworkCd As DBString
Dim reworkProcessId As DBString
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim createJobBom As Nullable(Of Boolean)
Dim editTime As Date
Job.Add(sessionId, woId, operId, seqNo, jobDesc, itemId, stateCd, jobPriority, reqFinishTimeLocal, initSchedEntId, targetSchedEntId, runEntId, qtyReqd, qtyProd, qtyProdErp, qtyRejected, qtyRejectedErp, qtyAtStart, deviationAbove, deviationBelow, batchSize, schedPinned, checkInv, estFixedLab, estLabRate, estSetupTime, estTeardownTime, estProdRate, prodUom, estTransferTime, schedStartTimeLocal, latestStartTimeLocal, schedFinishTimeLocal, actStartTimeLocal, actFinishTimeLocal, concurrentLink, jobCost, parentContingentJob, childContingentJob, notes, assocFile, assocFileType, statusNotes, displaySeq, folderVerId, rework, reworkCd, reworkProcessId, spare1, spare2, spare3, spare4, lastEditComment, createJobBom, editTime)
public static void Add(
int sessionId,
string woId,
string operId,
int seqNo,
DBString jobDesc,
string itemId,
JobStateCode stateCd,
Nullable<int> jobPriority,
DBDateTime reqFinishTimeLocal,
int initSchedEntId,
int targetSchedEntId,
DBInt runEntId,
double qtyReqd,
Nullable<double> qtyProd,
DBDouble qtyProdErp,
Nullable<double> qtyRejected,
DBDouble qtyRejectedErp,
double qtyAtStart,
Nullable<double> deviationAbove,
Nullable<double> deviationBelow,
Nullable<double> batchSize,
Nullable<bool> schedPinned,
Nullable<bool> checkInv,
DBDouble estFixedLab,
DBDouble estLabRate,
DBDouble estSetupTime,
DBDouble estTeardownTime,
double estProdRate,
ProdUnitOfMeasure prodUom,
DBDouble estTransferTime,
DBDateTime schedStartTimeLocal,
DBDateTime latestStartTimeLocal,
DBDateTime schedFinishTimeLocal,
DBDateTime actStartTimeLocal,
DBDateTime actFinishTimeLocal,
Nullable<int> concurrentLink,
DBDouble jobCost,
Nullable<bool> parentContingentJob,
Nullable<bool> childContingentJob,
DBString notes,
DBString assocFile,
DBString assocFileType,
DBString statusNotes,
int displaySeq,
DBString folderVerId,
Nullable<bool> rework,
DBString reworkCd,
DBString reworkProcessId,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
Nullable<bool> createJobBom,
out DateTime editTime
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- woId
- Required. Holds the work order for the job.
- operId
- Required. Holds the ID of the operation for the job.
- seqNo
- Required. Holds the operation sequence number for the job.
- jobDesc
- Optional filter parameter. Holds the description of the job.
- itemId
- Required. Holds the ID of the item resulting from this job.
- stateCd
- Required. A JobStateCode enumeration that identifies the job state.
- jobPriority
- Optional. Holds the operation priority.
- reqFinishTimeLocal
- Optional. Holds the required completion date/time in the entity's local time.
- initSchedEntId
- Required. Holds the ID of the entity to which the job is initially scheduled.
- targetSchedEntId
- Required. Holds the ID of the entity to which job is actually scheduled.
- runEntId
- Optional. Holds the ID of the entity on which the job is actually run.
- qtyReqd
- Required. Holds the required quantity of the item.
- qtyProd
- Optional. Holds the quantity of the item produced so far.
- qtyProdErp
- Optional. Holds the quantity produced as uploaded to ERP.
- qtyRejected
- Optional. Holds the quantity of the item rejected so far.
- qtyRejectedErp
- Optional. Holds the quantity rejected as uploaded to ERP.
- qtyAtStart
- Required. Holds the quantity expected to be produced if there are no scrap/waste/rejects.
- deviationAbove
- Optional. Holds the portion of the start quantity by which total production can deviate above.
- deviationBelow
- Optional. Holds the portion of start quantity by which total production can deviate below.
- batchSize
- Optional. Holds the amount of product per batch.
- schedPinned
- Optional. Holds a flag that, if set to true, specifies that the start time is fixed and can not be changed.
- checkInv
- Optional. Holds a flag that, if set to true, specifies that sufficient component inventory is required to change the state to ‘Ready’.
- estFixedLab
- Optional. Holds the estimated fixed labor hours for setup and cleanup.
- estLabRate
- Optional. Holds the estimated variable labor batch time, depending on the production unit of measure (prod_uom).
- estSetupTime
- Optional. Holds the estimated entity hours for setup.
- estTeardownTime
- Optional. Holds the estimated entity hours for teardown.
- estProdRate
- Required. Holds the estimated entity batch rate or time, depending on the production unit of measure (prod_uom).
- prodUom
Required. Holds a ProdUnitOfMeasure enumeration that specifies the unit of measure for est_lab_rate and est_prod_rate.
0 = Hours per batch
1 = Minutes per batch
2 = Seconds per batch
3 = Batches per hour
4 = Batches per minute
5 = Batches per second
- estTransferTime
- Optional. Holds the transfer time (in hours) after the operation.
- schedStartTimeLocal
- Optional. Holds the scheduled start time in the entity's local time.
- latestStartTimeLocal
- Optional. Holds the latest start time in the entity's local time to meet the required finish time.
- schedFinishTimeLocal
- Optional. Holds the estimated completion time in the entity's local time.
- actStartTimeLocal
- Optional. Holds the actual start time in the entity's local time.
- actFinishTimeLocal
- Optional. Holds the actual completion time in the entity's local time.
- concurrentLink
- Optional. Holds an integer used to match up concurrent jobs.
- jobCost
- Optional. Holds additional (i.e., non-labor, non-machine, and non-material) cost associated specifically with this job.
- parentContingentJob
- Optional. Holds a flag that, if set to true, specifies that this job is for a group that will really be run on one or more children.
- childContingentJob
- Optional. Holds a flag that, if set to true, specifies that this is a potential job for one of a group of entities.
- notes
- Optional. Holds specific notes for this job, typically for the operator to read.
- assocFile
- Optional. Holds the path and file name of the file associated with the job.
- assocFileType
- Optional. Holds the file type of the file associated with the job.
- statusNotes
- Optional. Holds notes regarding job status; typically operator-entered (e.g., when suspending the job).
- displaySeq
- Required. An integer specifying the sequence of jobs independently of the operation ID. Used to sequence jobs in trees and flow diagrams.
- folderVerId
- Optional. Holds an optional link to specify a folder version for this job.
- rework
- Optional. Holds a flag that, if set to true, specifies that this job has required or does require rework.
- reworkCd
- Optional. Holds an integer specifying the rework behavior of this job.
- reworkProcessId
- Holds the process id of the rework process this job was created from if this job is for 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 describes why this record is being added.
- createJobBom
- Optional. Holds a flag that, if set to true, specifies that a corresponding job BOM record for BOM position 0 should automatically be created along with the new job record.
- editTime
- Output. Holds the returned date/time when this record was added. The EditTime 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.