Update Method (JobHistory)
- Last UpdatedNov 06, 2025
- 3 minute read
'Declaration
Public Shared Sub Update( _
ByVal sessionId As Integer, _
ByVal entityId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal jobStartUtc As Date, _
ByVal itemId As String, _
ByVal jobEndUtc As Date, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByRef lastEditAt As Nullable(Of Date) _
)
'Usage
Dim sessionId As Integer
Dim entityId As Integer
Dim woId As String
Dim operId As String
Dim seqNo As Integer
Dim jobStartUtc As Date
Dim itemId As String
Dim jobEndUtc As Date
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim lastEditAt As Nullable(Of Date)
JobHistory.Update(sessionId, entityId, woId, operId, seqNo, jobStartUtc, itemId, jobEndUtc, spare1, spare2, spare3, spare4, lastEditAt)
public static void Update(
int sessionId,
int entityId,
string woId,
string operId,
int seqNo,
DateTime jobStartUtc,
string itemId,
DateTime jobEndUtc,
string spare1,
string spare2,
string spare3,
string spare4,
out Nullable<DateTime> lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entityId
- Required. Holds the entity ID of the job.
- woId
- Required. Holds the work order ID of the job.
- operId
- Required. Holds the operation ID of the job.
- seqNo
- Required. Holds the sequence number of the job.
- jobStartUtc
- Required. Holds the start date/time (in UTC format) of the job.
- itemId
- Required. Holds the ID of the item that is produced by the job.
- jobEndUtc
- Required. Holds the end date/time of the job, in UTC.
- spare1
- Required. Holds the contents of the user-defined spare1 field.
- spare2
- Required. Holds the contents of the user-defined spare2 field.
- spare3
- Required. Holds the contents of the user-defined spare3 field.
- spare4
- Required. Holds the contents of the user-defined spare4 field.
- lastEditAt
Required. Holds the date/time when this record was added or last updated, for optimistic concurrency control. If it is specified, the passed value must match the lastEditAt value in the record for the update to succeed.
Output. Holds the date/time value when the record was updated by this called method.
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.
When job_end_utc is supplied with a non-null value, an error will be returned if any one of the following conditions are met:
- The job end time is prior to the job start time.
- The end time of the job overlaps with another job running on the entity at the same job position.
- The supplied job was running on a different job position at the same time.
- The supplied job was running on a different entity at the same time.
When all of these conditions pass, the job end time is updated in the Job_History table. Additionally, new buckets are created (if necessary) in the Job_Hour_History table for the statistics to be captured, and the statistics for the existing buckets (for the modified time period) are updated.