Add Method (ItemClass)
- Last UpdatedNov 06, 2025
- 3 minute read
The Add() method adds a new item class record to the Item_Class table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal itemClassId As String, _
ByVal itemClassDesc As String, _
ByVal produced As Boolean, _
ByVal consumed As Boolean, _
ByVal obsolete As Boolean, _
ByVal purchased As Boolean, _
ByVal sold As Boolean, _
ByVal lotNoFormat As DBString, _
ByVal lastLotNo As DBString, _
ByVal subLotNoFormat As DBString, _
ByVal lastSubLotNo As DBString, _
ByVal serialNoLvl As Integer, _
ByVal invUniqueByJob As Boolean, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim itemClassId As String
Dim itemClassDesc As String
Dim produced As Boolean
Dim consumed As Boolean
Dim obsolete As Boolean
Dim purchased As Boolean
Dim sold As Boolean
Dim lotNoFormat As DBString
Dim lastLotNo As DBString
Dim subLotNoFormat As DBString
Dim lastSubLotNo As DBString
Dim serialNoLvl As Integer
Dim invUniqueByJob As Boolean
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim lastEditAt As Date
ItemClass.Add(sessionId, itemClassId, itemClassDesc, produced, consumed, obsolete, purchased, sold, lotNoFormat, lastLotNo, subLotNoFormat, lastSubLotNo, serialNoLvl, invUniqueByJob, spare1, spare2, spare3, spare4, lastEditComment, lastEditAt)
public static void Add(
int sessionId,
string itemClassId,
string itemClassDesc,
bool produced,
bool consumed,
bool obsolete,
bool purchased,
bool sold,
DBString lotNoFormat,
DBString lastLotNo,
DBString subLotNoFormat,
DBString lastSubLotNo,
int serialNoLvl,
bool invUniqueByJob,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
out DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- itemClassId
- Required. Holds the ID of the item class.
- itemClassDesc
- Required. Holds the description of the item class.
- produced
- Required. Holds a flag that, if set to true, specifies that this item class can have produced items.
- consumed
- Required. Holds a flag that, if set to true, specifies that this item class can have consumed items.
- obsolete
- Required. Holds a flag that, if set to true, specifies that this item class can have obsolete items.
- purchased
- Required. Holds a flag that, if set to true, specifies that this item class can have purchased items.
- sold
- Required. Holds a flag that, if set to true, specifies that this item class can have sold items.
- lotNoFormat
- Optional. Holds the format of the lot number.
- lastLotNo
- Optional. Holds the last lot number that was used for an item in this class.
- subLotNoFormat
- Optional. Holds the format of the sublot number.
- lastSubLotNo
- Optional. Holds the last sublot number that was used for an item in this class.
- serialNoLvl
- Required. Holds the items based on the specified level.
- invUniqueByJob
- Required. Holds a flag that, if set to true, specifies that the item's inventory is unique by job, for items in this class.
- 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.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- 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 type of 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.