EndJob(Int32,String,Int32,String,String,Nullable<Int32>,String,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,Nullable<Int32>,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The EndJob() method ends a job on an entity.
This overload of the method uses the entity ID to identify the entity.
'Declaration
Public Overloads Shared Sub EndJob( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Nullable(Of Integer), _
ByVal statusNotes As String, _
ByVal checkPrivs As Nullable(Of Boolean), _
ByVal checkCerts As Nullable(Of Boolean), _
ByVal clientType As Nullable(Of Integer), _
ByVal jobPos As Nullable(Of Integer), _
ByVal noPropagation As Nullable(Of Integer) _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entId As Integer
Dim woId As String
Dim operId As String
Dim seqNo As Nullable(Of Integer)
Dim statusNotes As String
Dim checkPrivs As Nullable(Of Boolean)
Dim checkCerts As Nullable(Of Boolean)
Dim clientType As Nullable(Of Integer)
Dim jobPos As Nullable(Of Integer)
Dim noPropagation As Nullable(Of Integer)
JobExec.EndJob(sessionId, userId, entId, woId, operId, seqNo, statusNotes, checkPrivs, checkCerts, clientType, jobPos, noPropagation)
public static void EndJob(
int sessionId,
string userId,
int entId,
string woId,
string operId,
Nullable<int> seqNo,
string statusNotes,
Nullable<bool> checkPrivs,
Nullable<bool> checkCerts,
Nullable<int> clientType,
Nullable<int> jobPos,
Nullable<int> noPropagation
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the job is being ended.
- userId
- Required. Holds the ID of the user whose is ending the job.
- entId
- Required. Holds the ID of the entity on which the job is to be ended.
- woId
- Optional. Holds the work order ID of the job.
- operId
- Optional. Holds the operation ID of the job.
- seqNo
- Optional. Holds the job sequence number.
- statusNotes
- Optional. Holds notes associated with the state change. Default is null.
- checkPrivs
- Optional. Holds a flag that, if set to true, specifies that the user’s privileges should be checked before executing this action. Default is false.
- checkCerts
- Optional. Holds a flag that, if set to true, specifies that the produced quantities should be checked before allowing this job to be ended. Default is false.
- clientType
- Optional. Holds the type of client application that is trying to end the job. Default is 37 (Operator).
- jobPos
- Optional. Holds the job position. If greater than 1, jobs are running on this entity.
- noPropagation
- Optional. Holds the no propogation data type.
The work order ID, operation ID, and sequence number are all required to identify the job to be ended on the specified entity. For the method to succeed, the specified job must be currently running or suspended on the specified entity. If the call is successful:
- The Job table is updated as follows for the specified job:
state_cd = 4 (COMPLETED)
status_notes = status_notes
act_finish_time = current datetime
- The current job data fields in the Job_Exec table are updated as follows for this entity:
cur_wo_id = null
cur_oper_id = null
cur_seq_no = 0
cur_step_no = null
cur_step_start = null
- The job_end_utc and job_end_local fields in the Job_History table are updated with the end times, if supplied. Otherwise, they are updated with the current times.
- If any steps are currently active on the specified job, they are not automatically ended.