SetPendingReason(Int32,String,String,Int32,Nullable<Int32>,DBInt,DBInt,DBString) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The SetPendingReason() method sets the final reason code to replace a certain pending reason for the specified entity.
This overload of the method uses a site name and entity name to specify the entity.
'Declaration
Public Overloads Shared Sub SetPendingReason( _
ByVal sessionId As Integer, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal finalReasCd As Integer, _
ByVal logId As Nullable(Of Integer), _
ByVal periodAffected As DBInt, _
ByVal oldReasCd As DBInt, _
ByVal comments As DBString _
)
'Usage
Dim sessionId As Integer
Dim entName As String
Dim siteName As String
Dim finalReasCd As Integer
Dim logId As Nullable(Of Integer)
Dim periodAffected As DBInt
Dim oldReasCd As DBInt
Dim comments As DBString
UtilExec.SetPendingReason(sessionId, entName, siteName, finalReasCd, logId, periodAffected, oldReasCd, comments)
public static void SetPendingReason(
int sessionId,
string entName,
string siteName,
int finalReasCd,
Nullable<int> logId,
DBInt periodAffected,
DBInt oldReasCd,
DBString comments
)
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 pending reason code is being set.
- siteName
- Optional. Holds the site name of the entity whose pending reason code is being set.
- finalReasCd
- Holds the final reason code to replace the pending reasons on this entity for this utilization event.
- logId
- Optional. Holds the log ID of the current utilization event to override the non-final reason with the supplied final reason.
- periodAffected
- Optional. Holds the number of minutes to go back in the past in the Util_History table searching for pending reasons to replace.
- oldReasCd
- Optional.
- comments
- Optional. Holds additional information for the new reason.
This method first reads the existing utilization event from the Util_History table. The logId, periodAffected, and oldReasCd optional parameters can be used to filter the search for pending reasons to replace. If the oldReasCd filter parameter is specified, then the matching reas_cd values with reas_pending=true are updated. If all the filters are supplied, then all the filters are applied to the search criteria. If logId or periodAffected are not supplied, then the latest non-final reason is overridden with the final reason. If any of the row that match those of the criteria logId or periodAffected are overridden with the final reason. This method also resets the reas_reqd flag in the Util_Exec table if the final reason is overridden with the latest non-final reason.