Add(Int32,String,Boolean,Boolean,Int32,Int32,DBString,Int32,DateTime) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The Add() method adds a new item grade record to the Item_Grade table and gets back the item grade code.
'Declaration
Public Overloads Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal itemGradeDesc As String, _
ByVal goodProd As Boolean, _
ByVal scrapped As Boolean, _
ByVal color As Integer, _
ByVal pref As Integer, _
ByVal lastEditComment As DBString, _
ByRef itemGradeCd As Integer, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim itemGradeDesc As String
Dim goodProd As Boolean
Dim scrapped As Boolean
Dim color As Integer
Dim pref As Integer
Dim lastEditComment As DBString
Dim itemGradeCd As Integer
Dim lastEditAt As Date
ItemGrade.Add(sessionId, itemGradeDesc, goodProd, scrapped, color, pref, lastEditComment, itemGradeCd, lastEditAt)
public static void Add(
int sessionId,
string itemGradeDesc,
bool goodProd,
bool scrapped,
int color,
int pref,
DBString lastEditComment,
out int itemGradeCd,
out DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- itemGradeDesc
- Required. Holds the description of the item grade.
- goodProd
- Required. Holds a flag that, if set to true, specifies that the item grade indicates good production. If set to false, the item grade indicates a rejected item.
- scrapped
- Required. Holds a flag that, if set to true, specifies that the item grade indicates a scrapped item. If set to false, the item grade indicates normal consumption.
- color
- Required. Holds an integer that indicates the grade's RGB background color in the user interface.
- pref
- Holds a number that indicates the preference ordering of the grade. Used in shipping and consumption. Must be greater than 0. The default is 1.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- itemGradeCd
- Output. Holds the item grade code assigned to the new item grade that is 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.