SetRawReason(Int32,String,String,String,DBDateTime,DBString,DBString,DBString,DBString,DBString) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The SetRawReason() method sets the current reason code for the specified entity based on a raw reason code received directly from the I/O system. This raw reason code will specify a default ‘final’ reason code, and if so configured will prompt the user with a list of possible final reasons for the given raw reason.
This overload of the method uses a site name and entity name to specify the entity.
'Declaration
Public Overloads Shared Sub SetRawReason( _
ByVal sessionId As Integer, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal rawReasCd As String, _
ByVal newReasStart As DBDateTime, _
ByVal comments As DBString, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString _
)
'Usage
Dim sessionId As Integer
Dim entName As String
Dim siteName As String
Dim rawReasCd As String
Dim newReasStart As DBDateTime
Dim comments As DBString
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
UtilExec.SetRawReason(sessionId, entName, siteName, rawReasCd, newReasStart, comments, spare1, spare2, spare3, spare4)
public static void SetRawReason(
int sessionId,
string entName,
string siteName,
string rawReasCd,
DBDateTime newReasStart,
DBString comments,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entName
- Required. Holds the name of the entity whose raw reason code is being set.
- siteName
- Optional. Holds the site name of the entity whose raw reason code is being set.
- rawReasCd
- Required. Holds the new raw reason code for the entity.
- newReasStart
- Optional. Holds the start date/time of the new raw reason. If set to null, the current date and time is used as the start time.
- comments
- Optional. Holds additional information about the new reason.
- 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.
This method first extracts the Util_Raw_Reas table to get the default final reason for this raw reason and whether to use it for a final reason or not. If the supplied newReasonStart parameter is in the past, then a new utilization record is created with the supplied start time by removing all the utilization events that exists after the supplied reason start time.