PauseJob(Int32,String,Int32,String,String,Int32,Int32,String,Nullable<Boolean>,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The PauseJob() method stops, suspends, or puts on hold the specified job running on the specified entity.
This overload of the method uses the entity ID to specify the entity.
'Declaration
Public Overloads Shared Sub PauseJob( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal pausedJobState As Integer, _
ByVal statusNotes As String, _
ByVal checkPrivs As Nullable(Of Boolean), _
ByVal jobPos 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 Integer
Dim pausedJobState As Integer
Dim statusNotes As String
Dim checkPrivs As Nullable(Of Boolean)
Dim jobPos As Nullable(Of Integer)
JobExec.PauseJob(sessionId, userId, entId, woId, operId, seqNo, pausedJobState, statusNotes, checkPrivs, jobPos)
public static void PauseJob(
int sessionId,
string userId,
int entId,
string woId,
string operId,
int seqNo,
int pausedJobState,
string statusNotes,
Nullable<bool> checkPrivs,
Nullable<int> jobPos
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the job is being paused.
- userId
- Required. Holds the ID of the user who is pausing the job.
- entId
- Required. Holds the ID of the entity on which the job is running.
- woId
- Required. Holds the work order ID of the job.
- operId
- Required. Holds the operation ID of the job.
- seqNo
- Required. Holds the job sequence number.
- pausedJobState
- Required. Holds the new state of the job. Valid values are 1 (New), 2 (Ready), 4 (Complete), 5 (Suspended), 6 (Onhold).
- 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.
- jobPos
- Optional. Holds the job position. If greater than 1, jobs are running on this entity.
The work order ID, operation ID, and sequence number are all required to identify the job to be paused on the specified entity.
For the method to succeed, the job must be currently running on the specified entity.
If the pausedJobState parameter is invalid, then it is defaulted to 5 (Suspended).
If the call is successful, the Job table is updated as follows for the specified job:
state_cd = paused_job_state
status_notes = status_notes
act_finish_time = current datetime
If the call is successful, 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* times in the Job_History table are updated with the current time.