Add Method (Attr)
- Last UpdatedNov 06, 2025
- 3 minute read
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal predefined As Nullable(Of Boolean), _
ByVal dataType As Nullable(Of Integer), _
ByVal attrDesc As String, _
ByVal attrGrp As Integer, _
ByVal filtr As DBString, _
ByVal entryType As Nullable(Of Integer), _
ByVal visibleInQueue As Nullable(Of Boolean), _
ByVal visibleInInv As Nullable(Of Boolean), _
ByVal lastEditComment As DBString, _
ByRef lastEditAt As Date, _
ByRef attrId As Integer _
)
'Usage
Dim sessionId As Integer
Dim predefined As Nullable(Of Boolean)
Dim dataType As Nullable(Of Integer)
Dim attrDesc As String
Dim attrGrp As Integer
Dim filtr As DBString
Dim entryType As Nullable(Of Integer)
Dim visibleInQueue As Nullable(Of Boolean)
Dim visibleInInv As Nullable(Of Boolean)
Dim lastEditComment As DBString
Dim lastEditAt As Date
Dim attrId As Integer
Attr.Add(sessionId, predefined, dataType, attrDesc, attrGrp, filtr, entryType, visibleInQueue, visibleInInv, lastEditComment, lastEditAt, attrId)
public static void Add(
int sessionId,
Nullable<bool> predefined,
Nullable<int> dataType,
string attrDesc,
int attrGrp,
DBString filtr,
Nullable<int> entryType,
Nullable<bool> visibleInQueue,
Nullable<bool> visibleInInv,
DBString lastEditComment,
out DateTime lastEditAt,
out int attrId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- predefined
- Optional. Holds a flag that, if set to true, specifies that the attribute is assigned to a set of predefined values.
- dataType
Optional. Holds the enumeration that identifies the data type of the attribute.
0 = string (less than 80 characters; the default data type)
1 = drop down list of values defined in the attr_set table
2 = integer
3 = currency
4 = color
5 = date/time
6 = floating point number
7 = percent
8 = check box
9 = non-editable
10 = time of day
11 = item reason (only if attr_grp = 3)
12 = long string (> 80 characters)
May be extended in future releases.
- attrDesc
- Required. Holds the attribute description. The description must be unique within a given attribute group.
- attrGrp
Required. Holds the enumeration that identifies the group to which the attribute belongs.
1 = Items
2 = Entities
3 = Lots
4 = Item Classes
5 = Jobs
6 = WO
7 = Operations
8 = Processes
9 = Sublot
10 = Samples
11 = Results
12 = Lines
13 = Shifts
- filtr
- Optional. Holds the string that identifies the filter for the situations to which this attribute applies. For example, for item reason attributes, this is a reason_grp_id.
- entryType
Optional. Holds the enumeration that identifies the type of entry to allow for this attribute.
0 = value only (the default)
1 = notes only
2 = value and notes
- visibleInQueue
- Optional. Holds a flag that, if set to true, specifies that this attribute will be visible in the job queue. The default is false. It may be true only if attr_grp = 1, 5, or 6, entry_type is not 1, and data_type is not 12.
- visibleInInv
- Optional. Holds a flag that, if set to true, specifies that this attribute will be visible in the inventory. The default is false. It may be true only if attr_grp = 1 or 3, entry_type is not 1, and data_type is not 12.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- lastEditAt
- Output. Holds the returned date/time when this record was added, for optimistic concurrency control. The lastEditAt parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
- attrId
- Output. Holds the returned unique ID of the attribute that was added.
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.