Update Method (UtilHistory)
- Last UpdatedMar 17, 2026
- 3 minute read
The Update() method updates all columns of the specified utilization event record in the Util_History table.
'Declaration
Public Shared Sub Update( _
ByVal sessionId As Integer, _
ByVal entityId As Integer, _
ByVal eventTimeUtc As Date, _
ByVal reasonCode As Integer, _
ByVal reasonPending As Boolean, _
ByVal comments As String, _
ByVal rawReasonCode As String, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal category1 As String, _
ByVal category2 As String, _
ByVal category3 As String, _
ByVal category4 As String, _
ByRef lastEditAt As Date, _
ByRef recordsAffected As Integer _
)
'Usage
Dim sessionId As Integer
Dim entityId As Integer
Dim eventTimeUtc As Date
Dim reasonCode As Integer
Dim reasonPending As Boolean
Dim comments As String
Dim rawReasonCode As String
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim category1 As String
Dim category2 As String
Dim category3 As String
Dim category4 As String
Dim lastEditAt As Date
Dim recordsAffected As Integer
UtilHistory.Update(sessionId, entityId, eventTimeUtc, reasonCode, reasonPending, comments, rawReasonCode, spare1, spare2, spare3, spare4, category1, category2, category3, category4, lastEditAt, recordsAffected)
public static void Update(
int sessionId,
int entityId,
DateTime eventTimeUtc,
int reasonCode,
bool reasonPending,
string comments,
string rawReasonCode,
string spare1,
string spare2,
string spare3,
string spare4,
string category1,
string category2,
string category3,
string category4,
ref DateTime lastEditAt,
out int recordsAffected
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entityId
- Required. Holds the ID of the entity whose utilization event is being updated.
- eventTimeUtc
- Required. Holds the date/time in UTC for the start time of the utilization event that is being updated. This parameter, along with the entity ID, is used to identify the event record.
- reasonCode
- Required. Holds the code that identifies the reason for the utilization event.
- reasonPending
- Required. Holds a flag that indicates whether or not the reason is pending and needs to be finalized.
- comments
- Required. Holds text to describe the event.
- rawReasonCode
- Required. Holds the code identifying the raw reason that is used to determine the utilization reason.
- 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.
- category1
- Required. Holds a user defined field that describes category1.
- category2
- Required. Holds a user defined field that describes category2.
- category3
- Required. Holds a user defined field that describes category3.
- category4
- Required. Holds a user defined field that describes category4.
- lastEditAt
Output. Holds the returned date/time when this record was added. The lastEditAt parameter is used by other methods that modify or delete this record for optimistic concurrency control.
- recordsAffected
Output. Holds the number of existing event records that were affected by the transaction (that is, split, merged, or deleted).
If the update passes values that are exactly the same as the preceding event, then the events will be merged (the end time of the previous event will be changed to the end time of the supplied event, and the supplied event will be deleted).
Similarly, if the update passes values that are exactly the same as the subsequent event, then the events will be merged (the end time of the supplied event will be changed to the end time of the subsequent event, and the subsequent event will be deleted).
Required non-DB* parameters must pass a value. They cannot be empty or null.