UpdateSpecific Method (UtilLog)
- Last UpdatedNov 06, 2025
- 3 minute read
The UpdateSpecific() method is maintained for compatibility with MES versions prior to 6.0. For new projects, this method should not be used. Instead, use the UpdateSpecific() method in the UtilHistory class.
The UpdateSpecific() method updates selected columns for the specified utilization history event in the Util_History table.
'Declaration
Public Shared Sub UpdateSpecific( _
ByVal sessionId As Integer, _
ByVal logId As Integer, _
ByVal eventTimeLocal As Nullable(Of Date), _
ByVal reasCd As Nullable(Of Integer), _
ByVal reasPending As Nullable(Of Boolean), _
ByVal duration As Nullable(Of Integer), _
ByVal comments As DBString, _
ByVal rawReasCd As DBString, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef lastEditAt As Nullable(Of Date) _
)
'Usage
Dim sessionId As Integer
Dim logId As Integer
Dim eventTimeLocal As Nullable(Of Date)
Dim reasCd As Nullable(Of Integer)
Dim reasPending As Nullable(Of Boolean)
Dim duration As Nullable(Of Integer)
Dim comments As DBString
Dim rawReasCd As DBString
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim lastEditAt As Nullable(Of Date)
UtilLog.UpdateSpecific(sessionId, logId, eventTimeLocal, reasCd, reasPending, duration, comments, rawReasCd, spare1, spare2, spare3, spare4, lastEditComment, lastEditAt)
public static void UpdateSpecific(
int sessionId,
int logId,
Nullable<DateTime> eventTimeLocal,
Nullable<int> reasCd,
Nullable<bool> reasPending,
Nullable<int> duration,
DBString comments,
DBString rawReasCd,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
ref Nullable<DateTime> lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- logId
- Required. Holds the ID of the utilization history event.
- eventTimeLocal
- Optional. Holds the local start time of the event. Cannot be more than 2 minutes in the future; otherwise, an error will be returned. See the Remarks section below for the ramifications of changing the local start time.
- reasCd
- Optional. Holds the reason code.
- reasPending
- Optional. Holds the logical data type to prompt the user whether to override the reason code or not.
- duration
- Optional. Holds the duration of the event in seconds. Cannot be 0; otherwise, an error will be returned. See the Remarks section below for the ramifications of changing the duration.
- comments
- Optional. Holds the text describing the event.
- rawReasCd
- Optional. Holds the underlying raw reason code.
- 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 describe why this record is being updated.
- lastEditAt
- This parameter is not used with this method.
Note the following behavior regarding updates to the event's local start time (the eventTimeLocal parameter) and/or duration (the duration parameter).
If this event's new start time is earlier than its current start time, then:
- Any prior events whose start time is later than this event's new start time are deleted.
- The duration of the prior event that will now precede this event, if one exists, will be decreased so that the prior event ends when this event begins.
If this event's new start time is later than its current start time, then the event time gap is filled by increasing the duration of the prior event so that the prior event ends when this event begins.
If this event's new end time is later than its current end time, then:
- Any later events whose end time is earlier than then this event's new end time are deleted.
- The duration of the next event that will now follow this event, if one exists, will be increased so that the next event starts when this event ends.
If the event's new end time is earlier than its current end time, then the event time gap is filled by increasing the duration of the next event so that it begins when this event ends.
If the update also results in two identical adjacent events, then the two records are merged into a single event. Note that the duration is not considered when determining if the two adjacent events are identical (i.e., two adjacent events do not have to have the same duration to be merged).
In all cases, the appropriate adjustments are also made to all the records in the Job_History table and Job_Hour_History table.