Add Method (Item)
- Last UpdatedNov 06, 2025
- 5 minute read
The Add() method adds a new item record to the Item table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal itemId As String, _
ByVal itemDesc As String, _
ByVal itemClassId As String, _
ByVal uomId As Integer, _
ByVal template As Boolean, _
ByVal lifetime As DBInt, _
ByVal unitCost As DBDouble, _
ByVal obsolete As Boolean, _
ByVal purchased As Boolean, _
ByVal sold As Boolean, _
ByVal numDecimals As Integer, _
ByVal mustCompleteSteps As Boolean, _
ByVal mustProdReqdQty As Boolean, _
ByVal minGrade As DBInt, _
ByVal minState As DBInt, _
ByVal minInvLevel As DBDouble, _
ByVal reOrderAmt As DBDouble, _
ByVal autoReOrder As Boolean, _
ByVal lotNoFormat As DBString, _
ByVal lastLotNo As DBString, _
ByVal maxLotSize As DBDouble, _
ByVal subLotNoFormat As DBString, _
ByVal lastSubLotNo As DBString, _
ByVal serialNoLvl As Integer, _
ByVal maxSubLotSize As DBDouble, _
ByVal maxOrderSize As DBDouble, _
ByVal minTraceInv As DBDouble, _
ByVal invUniqueByJob As Boolean, _
ByVal notes As DBString, _
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 itemId As String
Dim itemDesc As String
Dim itemClassId As String
Dim uomId As Integer
Dim template As Boolean
Dim lifetime As DBInt
Dim unitCost As DBDouble
Dim obsolete As Boolean
Dim purchased As Boolean
Dim sold As Boolean
Dim numDecimals As Integer
Dim mustCompleteSteps As Boolean
Dim mustProdReqdQty As Boolean
Dim minGrade As DBInt
Dim minState As DBInt
Dim minInvLevel As DBDouble
Dim reOrderAmt As DBDouble
Dim autoReOrder As Boolean
Dim lotNoFormat As DBString
Dim lastLotNo As DBString
Dim maxLotSize As DBDouble
Dim subLotNoFormat As DBString
Dim lastSubLotNo As DBString
Dim serialNoLvl As Integer
Dim maxSubLotSize As DBDouble
Dim maxOrderSize As DBDouble
Dim minTraceInv As DBDouble
Dim invUniqueByJob As Boolean
Dim notes As DBString
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim lastEditAt As Date
Item.Add(sessionId, itemId, itemDesc, itemClassId, uomId, template, lifetime, unitCost, obsolete, purchased, sold, numDecimals, mustCompleteSteps, mustProdReqdQty, minGrade, minState, minInvLevel, reOrderAmt, autoReOrder, lotNoFormat, lastLotNo, maxLotSize, subLotNoFormat, lastSubLotNo, serialNoLvl, maxSubLotSize, maxOrderSize, minTraceInv, invUniqueByJob, notes, spare1, spare2, spare3, spare4, lastEditComment, lastEditAt)
public static void Add(
int sessionId,
string itemId,
string itemDesc,
string itemClassId,
int uomId,
bool template,
DBInt lifetime,
DBDouble unitCost,
bool obsolete,
bool purchased,
bool sold,
int numDecimals,
bool mustCompleteSteps,
bool mustProdReqdQty,
DBInt minGrade,
DBInt minState,
DBDouble minInvLevel,
DBDouble reOrderAmt,
bool autoReOrder,
DBString lotNoFormat,
DBString lastLotNo,
DBDouble maxLotSize,
DBString subLotNoFormat,
DBString lastSubLotNo,
int serialNoLvl,
DBDouble maxSubLotSize,
DBDouble maxOrderSize,
DBDouble minTraceInv,
bool invUniqueByJob,
DBString notes,
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.
- itemId
- Required. Holds the ID of the item.
- itemDesc
- Required. Holds the description of the item.
- itemClassId
- Required. Holds the ID of the item class.
- uomId
- Required. Holds the ID of the unit of measure for the item.
- template
- Required. Holds a flag that, if set to true, indicates that the item is a template to be copied, not an actual item.
- lifetime
- Optional. Holds the number of days that is the lifetime of the item, from manufacture to expiry.
- unitCost
- Optional. Holds the unit cost of the item.
- obsolete
- Required. Holds a flag that, if set to true, specifies that the item is obsolete.
- purchased
- Required. Holds a flag that, if set to true, specifies that the item is purchased.
- sold
- Required. Holds a flag that, if set to true, specifies that the item is sold.
- numDecimals
- Required. Holds the number of decimal places to use when specifying a quantity of the item.
- mustCompleteSteps
- Required. Holds a flag that, if set to true, indicates that the item can complete steps.
- mustProdReqdQty
- Required. Holds a flag that, if set to true, specifies that this item can produce the required quantity.
- minGrade
- Optional. Holds the lowest shippable grade.
- minState
- Optional. Holds the lowest shippable state.
- minInvLevel
- Optional. Holds the overall amount of this item in the inventory below which a replenishment order should be generated.
- reOrderAmt
- Optional. Holds the minimum replenishment order amount.
- autoReOrder
- Required. Holds a flag that, if set to true, specifies that the replenishment order be generated automatically.
- lotNoFormat
- Optional. Holds the format of the lot number.
- lastLotNo
- Optional. Holds the last lot number that was used for an item.
- maxLotSize
- Optional. Holds the item's maximum lot size.
- subLotNoFormat
- Optional. Holds the format of the sublot number.
- lastSubLotNo
- Optional. Holds the last sublot number that was used for an item.
- serialNoLvl
- Required. Holds a value that determines what level represents a serial number for this item: < 0, not a serialized item 0, lot number > 0, sublot number.
- maxSubLotSize
- Optional. Holds the item's maximum sublot size.
- maxOrderSize
- Optional. Holds the maximum quantity that can be specified in a work order for the item.
- minTraceInv
- Optional. Holds the minimum traceable inventory for the item.
- invUniqueByJob
- Required. Holds a flag that, if set to true, specifies that the item's inventory is unique by job.
- notes
- Optional. Holds notes about the item.
- 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.