Add(Int32,String,Int32,Int32,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,DBString,Int32,Int32,Nullable<Int32>,Nullable<Int32>,Nullable<Double>,Nullable<Double>,Nullable<Double>,Nullable<Boolean>,DBString,DBString,DBString,DBString,DBString,Int32,DateTime) Method
- Last UpdatedNov 06, 2025
- 5 minute read
The Add() method adds a utilization reason record to the Util_Reas table.
'Declaration
Public Overloads Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal reasDesc As String, _
ByVal reasGrpId As Integer, _
ByVal stateCd As Integer, _
ByVal runtime As Boolean, _
ByVal downtime As Boolean, _
ByVal setuptime As Boolean, _
ByVal teardownTime As Boolean, _
ByVal fixedtime As Boolean, _
ByVal vartime As Boolean, _
ByVal failure As Boolean, _
ByVal defLabCode As DBString, _
ByVal displaySeq As Integer, _
ByVal priority As Integer, _
ByVal maxDuration As Nullable(Of Integer), _
ByVal newReasonCode As Nullable(Of Integer), _
ByVal standardTime As Nullable(Of Double), _
ByVal minTime As Nullable(Of Double), _
ByVal maxTime As Nullable(Of Double), _
ByVal entityEnabled As Nullable(Of Boolean), _
ByVal category1 As DBString, _
ByVal category2 As DBString, _
ByVal category3 As DBString, _
ByVal category4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef reasCode As Integer, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim reasDesc As String
Dim reasGrpId As Integer
Dim stateCd As Integer
Dim runtime As Boolean
Dim downtime As Boolean
Dim setuptime As Boolean
Dim teardownTime As Boolean
Dim fixedtime As Boolean
Dim vartime As Boolean
Dim failure As Boolean
Dim defLabCode As DBString
Dim displaySeq As Integer
Dim priority As Integer
Dim maxDuration As Nullable(Of Integer)
Dim newReasonCode As Nullable(Of Integer)
Dim standardTime As Nullable(Of Double)
Dim minTime As Nullable(Of Double)
Dim maxTime As Nullable(Of Double)
Dim entityEnabled As Nullable(Of Boolean)
Dim category1 As DBString
Dim category2 As DBString
Dim category3 As DBString
Dim category4 As DBString
Dim lastEditComment As DBString
Dim reasCode As Integer
Dim lastEditAt As Date
UtilReas.Add(sessionId, reasDesc, reasGrpId, stateCd, runtime, downtime, setuptime, teardownTime, fixedtime, vartime, failure, defLabCode, displaySeq, priority, maxDuration, newReasonCode, standardTime, minTime, maxTime, entityEnabled, category1, category2, category3, category4, lastEditComment, reasCode, lastEditAt)
public static void Add(
int sessionId,
string reasDesc,
int reasGrpId,
int stateCd,
bool runtime,
bool downtime,
bool setuptime,
bool teardownTime,
bool fixedtime,
bool vartime,
bool failure,
DBString defLabCode,
int displaySeq,
int priority,
Nullable<int> maxDuration,
Nullable<int> newReasonCode,
Nullable<double> standardTime,
Nullable<double> minTime,
Nullable<double> maxTime,
Nullable<bool> entityEnabled,
DBString category1,
DBString category2,
DBString category3,
DBString category4,
DBString lastEditComment,
out int reasCode,
out DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is calling this method.
- reasDesc
- Required. Holds the description of the utilization reason.
- reasGrpId
- Required. Holds the ID of the reason group to which the utilization reason is linked.
- stateCd
- Required. Holds the state code for the utilization reason.
- runtime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward runtime events.
- downtime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward downtime events.
- setuptime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward setup time events.
- teardownTime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward teardown time events.
- fixedtime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward fixed time events.
- vartime
- Required. Holds a flag that, if set to true, specifies that the utilization reason counts toward variable time events.
- failure
- Required. Holds a flag that, if set to true, specifies that any time that the entity spends in this utilization reason code is considered failure time.
- defLabCode
- Optional. Holds the default labor code to be used for the utilization reason when it is manually selected.
- displaySeq
- Required. Holds the utilization reason's display sequence number. This number determines the order of utilization reasons when they are listed under their utilization reason group in the user interface.
- priority
- Required. Holds the utilization reason's priority, which is used to determine the reason for a line that has two or more bottleneck entities with differing reasons.
- maxDuration
Optional. Holds the maximum duration, in seconds, that is used with setting a Severe flag or with the newReasonCode parameter.
- If the newReasonCode parameter is not being used (that is, it is null) and the maximum duration is exceeded, the reason is marked as being Severe and the event is considered to be in a severe condition. The Severe flag is typically used with downtime events.
- If the newReasonCode parameter is being used and the maximum duration is exceeded, the utilization reason for the entity is changed to the new reason specified in the newReasonCode parameter.
- newReasonCode
- Optional. Holds the utilization reason to which this reason should change when the maximum duration is exceeded.
- standardTime
- Optional. Holds the standard amount of time, in minutes, that an entity is expected to be in this utilization reason.
- minTime
- Optional. Holds the minimum amount of time, in minutes, that an entity is expected to be in this utilization reason.
- maxTime
- Optional. Holds the maximum amount of time, in minutes, that an entity is expected to be in this utilization reason.
- entityEnabled
- Optional. Holds the flag that, if set to true, indicates that an entity in this utilization reason is considered to be enabled.
- category1
- Optional. Holds a user-defined field that describes a category1.
- category2
- Optional. Holds a user-defined field that describes a category2.
- category3
- Optional. Holds a user-defined field that describes a category3.
- category4
- Optional. Holds a user-defined field that describes a category4.
- lastEditComment
- Optional. Holds comments that describes why this record is being added.
- reasCode
- Output. Holds the returned code for the new reason.
- 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.
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.