Add Method (JobBomSubstitute)
- Last UpdatedNov 06, 2025
- 6 minute read
The Add() method adds a new job BOM substitute record to the Job_Bom_Subst table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal bomPos As Integer, _
ByVal altNo As Integer, _
ByVal pref As Integer, _
ByVal substLevel As Nullable(Of Integer), _
ByVal itemId As String, _
ByVal reqdGradeCd As DBInt, _
ByVal instruction As DBString, _
ByVal qtyPerParentItem As Double, _
ByVal maxQtyPerParentItem As DBDouble, _
ByVal minQtyPerParentItem As DBDouble, _
ByVal reqdStartVal As Nullable(Of Double), _
ByVal reqdStartValIsPct As Nullable(Of Boolean), _
ByVal updateInv As Nullable(Of Boolean), _
ByVal backflush As Nullable(Of Boolean), _
ByVal defReasCd As DBInt, _
ByVal defLotNo As DBString, _
ByVal defStorageEntId As DBInt, _
ByVal defRejectEntId As DBInt, _
ByVal scalingFactor As DBDouble, _
ByVal mustConsumeFromInv As Nullable(Of Boolean), _
ByVal mayChooseAltInvLoc As Nullable(Of Boolean), _
ByVal mayCreateNewLots As Nullable(Of Boolean), _
ByVal mustConsumeFromWip As Nullable(Of Boolean), _
ByVal mustConsumeBeforeProd As Nullable(Of Boolean), _
ByVal constantQty As Nullable(Of Boolean), _
ByVal estTime As DBDouble, _
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 woId As String
Dim operId As String
Dim seqNo As Integer
Dim bomPos As Integer
Dim altNo As Integer
Dim pref As Integer
Dim substLevel As Nullable(Of Integer)
Dim itemId As String
Dim reqdGradeCd As DBInt
Dim instruction As DBString
Dim qtyPerParentItem As Double
Dim maxQtyPerParentItem As DBDouble
Dim minQtyPerParentItem As DBDouble
Dim reqdStartVal As Nullable(Of Double)
Dim reqdStartValIsPct As Nullable(Of Boolean)
Dim updateInv As Nullable(Of Boolean)
Dim backflush As Nullable(Of Boolean)
Dim defReasCd As DBInt
Dim defLotNo As DBString
Dim defStorageEntId As DBInt
Dim defRejectEntId As DBInt
Dim scalingFactor As DBDouble
Dim mustConsumeFromInv As Nullable(Of Boolean)
Dim mayChooseAltInvLoc As Nullable(Of Boolean)
Dim mayCreateNewLots As Nullable(Of Boolean)
Dim mustConsumeFromWip As Nullable(Of Boolean)
Dim mustConsumeBeforeProd As Nullable(Of Boolean)
Dim constantQty As Nullable(Of Boolean)
Dim estTime As DBDouble
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim lastEditAt As Date
JobBomSubstitute.Add(sessionId, woId, operId, seqNo, bomPos, altNo, pref, substLevel, itemId, reqdGradeCd, instruction, qtyPerParentItem, maxQtyPerParentItem, minQtyPerParentItem, reqdStartVal, reqdStartValIsPct, updateInv, backflush, defReasCd, defLotNo, defStorageEntId, defRejectEntId, scalingFactor, mustConsumeFromInv, mayChooseAltInvLoc, mayCreateNewLots, mustConsumeFromWip, mustConsumeBeforeProd, constantQty, estTime, spare1, spare2, spare3, spare4, lastEditComment, lastEditAt)
public static void Add(
int sessionId,
string woId,
string operId,
int seqNo,
int bomPos,
int altNo,
int pref,
Nullable<int> substLevel,
string itemId,
DBInt reqdGradeCd,
DBString instruction,
double qtyPerParentItem,
DBDouble maxQtyPerParentItem,
DBDouble minQtyPerParentItem,
Nullable<double> reqdStartVal,
Nullable<bool> reqdStartValIsPct,
Nullable<bool> updateInv,
Nullable<bool> backflush,
DBInt defReasCd,
DBString defLotNo,
DBInt defStorageEntId,
DBInt defRejectEntId,
DBDouble scalingFactor,
Nullable<bool> mustConsumeFromInv,
Nullable<bool> mayChooseAltInvLoc,
Nullable<bool> mayCreateNewLots,
Nullable<bool> mustConsumeFromWip,
Nullable<bool> mustConsumeBeforeProd,
Nullable<bool> constantQty,
DBDouble estTime,
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.
- woId
Required. Holds the ID of the work order for the job.
- operId
Required. Holds the ID of the operation for the job.
- seqNo
Required. Holds the operation sequence number of the job.
- bomPos
Required. Holds the BOM position.
- altNo
Required. Holds the alternative for the given BOM position.
- pref
Required. Holds an integer that is used to sort alternatives for a BOM position, by preference.
- substLevel
Required. Holds an integer that acts as a substitution privilege level, so that a user has to have this substituion level to be able to substitute the BOM item. The default is 0, which means anyone can use this substitute.
- itemId
Required. Holds the ID of the substitute item being produced or consumed.
- reqdGradeCd
Optional. Holds the required grade code for the BOM item.
- instruction
Optional. Holds the instructions on how to consume or produce this item.
- qtyPerParentItem
Optional. Holds the nominal quantity of the item required per unit of the parent item.
- maxQtyPerParentItem
Optional. Holds the maximum acceptable quantity of this BOM component.
- minQtyPerParentItem
Optional. Holds the minimum acceptable quantity of this BOM component.
- reqdStartVal
Optional. Holds the amount of the component required before running the job.
- reqdStartValIsPct
Optional. Holds a flag that, if set to true or false, specifies that the required start value is a percentage and, if set to false, specifies that the required start value is an absolute quantity. The default is true.
- updateInv
Optional. Holds a flag that, if set to true, specifies that the inventory table is updated with consumed items. The default is false.
- backflush
Optional. Holds a flag that, if set to true, specifies that consumption is backflushed. The default is false.
- defReasCd
Optional. Holds the ID of the default item reason code.
- defLotNo
Optional. Holds the default lot number of the item.
- defStorageEntId
Optional. Holds the default storage entity for the item or the by-product.
- defRejectEntId
Optional. Holds the default storage entity for the rejected production items. If null, the def_storage_ent_id is used.
- scalingFactor
Optional. Holds the number that specifies the scaling factor, which is used to get the correct units from counts if the counts are item dependent. The default is 1.
- mustConsumeFromInv
Optional. Holds a flag that, if set to true, specifies that consumption must occur from the inventory for this item. The default is false.
- mayChooseAltInvLoc
-
Optional. Holds a flag that, if set to true, specifies that the user can select alternate inventory locations when consuming or producing this item. The default is true.
- mayCreateNewLots
Optional. Holds a flag that, if set to true, specifies that the user can create new lots when consuming or producing this item. The default is true.
- mustConsumeFromWip
Optional. Holds a flag that, if set to true, specifies that the lots consumed during the job are limited to the lots produced to the Item_Inv table for the same work order in an upstream job. The default is false.
- mustConsumeBeforeProd
Optional. Holds a flag that, if set to true, specifies that the production transactions are prevented until 'acceptable' quantities of BOM components are consumed, as specified in the maxQtyPerParentItem and minQtyPerParentItemparameters. The default is false.
- constantQty
Optional. Holds a flag that, if set to true, specifies that the quantity of the consumed item is independent of the quantity of the parent item that is produced. The default is false.
- estTime
Optional. Holds the number of hours it should take to consume or produce the component per unit of BOM position zero. If null, the BOM position is zero.
- 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.