Update Method (BomItem)
- Last UpdatedNov 06, 2025
- 5 minute read
The Update() method updates all columns of the specified BOM item record in the Bom_Item table.
'Declaration
Public Shared Sub Update( _
ByVal sessionId As Integer, _
ByVal parentItemId As String, _
ByVal verId As String, _
ByVal bomPos As 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 updateInv As Boolean, _
ByVal backflush As Boolean, _
ByVal defReasCd As DBInt, _
ByVal defLotNo As DBString, _
ByVal defSubLotNo As DBString, _
ByVal defStorageEntId As DBInt, _
ByVal defRejectEntId As DBInt, _
ByVal scalingFactor As DBDouble, _
ByVal mustConsumeFromInv As Boolean, _
ByVal mayChooseAltInvLoc As Boolean, _
ByVal mayCreateNewLots As Boolean, _
ByVal mustConsumeFromWip As Boolean, _
ByVal mustConsumeBeforeProd As Boolean, _
ByVal constantQty As Boolean, _
ByVal estTime As DBDouble, _
ByVal serialNoSource As Boolean, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef modId As String _
)
'Usage
Dim sessionId As Integer
Dim parentItemId As String
Dim verId As String
Dim bomPos As 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 updateInv As Boolean
Dim backflush As Boolean
Dim defReasCd As DBInt
Dim defLotNo As DBString
Dim defSubLotNo As DBString
Dim defStorageEntId As DBInt
Dim defRejectEntId As DBInt
Dim scalingFactor As DBDouble
Dim mustConsumeFromInv As Boolean
Dim mayChooseAltInvLoc As Boolean
Dim mayCreateNewLots As Boolean
Dim mustConsumeFromWip As Boolean
Dim mustConsumeBeforeProd As Boolean
Dim constantQty As Boolean
Dim estTime As DBDouble
Dim serialNoSource As Boolean
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim modId As String
BomItem.Update(sessionId, parentItemId, verId, bomPos, itemId, reqdGradeCd, instruction, qtyPerParentItem, maxQtyPerParentItem, minQtyPerParentItem, updateInv, backflush, defReasCd, defLotNo, defSubLotNo, defStorageEntId, defRejectEntId, scalingFactor, mustConsumeFromInv, mayChooseAltInvLoc, mayCreateNewLots, mustConsumeFromWip, mustConsumeBeforeProd, constantQty, estTime, serialNoSource, spare1, spare2, spare3, spare4, lastEditComment, modId)
public static void Update(
int sessionId,
string parentItemId,
string verId,
int bomPos,
string itemId,
DBInt reqdGradeCd,
DBString instruction,
double qtyPerParentItem,
DBDouble maxQtyPerParentItem,
DBDouble minQtyPerParentItem,
bool updateInv,
bool backflush,
DBInt defReasCd,
DBString defLotNo,
DBString defSubLotNo,
DBInt defStorageEntId,
DBInt defRejectEntId,
DBDouble scalingFactor,
bool mustConsumeFromInv,
bool mayChooseAltInvLoc,
bool mayCreateNewLots,
bool mustConsumeFromWip,
bool mustConsumeBeforeProd,
bool constantQty,
DBDouble estTime,
bool serialNoSource,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
ref string modId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- parentItemId
-
Required. Holds the ID of the parent item being updated.
- verId
Required. Holds the ID of the BOM version.
- bomPos
Required. Holds the BOM position. For by-products, this value is negative. For produced items, the BOM position is 0 and the item_id is the same as the parent_item_id. The BOM position is usually in a sequence.
- itemId
Required. Holds the ID of the item being produced or consumed.
- reqdGradeCd
- Optional. Holds the required grade code for the BOM item. If null, an item of any grade code can be consumed.
- instruction
-
Required. Holds the instructions on how to consume or produce this item.
- qtyPerParentItem
Required. Holds the nominal quantity of the item required per unit of the current parent item.
- maxQtyPerParentItem
Required. Holds the maximum acceptable quantity of this BOM component.
- minQtyPerParentItem
Required. Holds the minimum acceptable quantity of this BOM component.
- updateInv
Required. Holds a flag that, if set to true, specifies that the inventory table is updated with consumed items.
- backflush
Required. Holds a flag that, if set to true, specifies that consumption is backflushed.
- defReasCd
Required. Holds the default consumption or production code of the item. If null, it defaults to the value specified for the entity that runs the job.
- defLotNo
Required. Holds the default lot number of this item. If null, it defaults to the lot number specified for the entity that runs the job.
- defSubLotNo
Required. Holds the default sublot number of this item. If null, it defaults to the sublot number specified for the entity that runs the job.
- defStorageEntId
Required. Holds the default storage entity for the product or by-product. If null, it defaults to the entity that runs the job.
- defRejectEntId
Required. Holds the ID of the default storage entity for the rejected production items. If null, the def_storage_ent_id is used.
- scalingFactor
Required. Holds the number that specifies the scaling factor, which is used to get the correct units from counts if the counts are item-dependent.
- mustConsumeFromInv
Required. Holds a flag that, if set to true, specifies that consumption must occur from the inventory for this item. The default is false.
- mayChooseAltInvLoc
Required. Holds a flag that, if set to true, specifies that a user can select alternate inventory locations when consuming or producing this item. The default is true.
- mayCreateNewLots
Required. Holds a flag that, if set to true, specifies that a user can create new lots when consuming or producing this item. The default is true.
This parameter is relevant only if the items are not consumed from the inventory.
- mustConsumeFromWip
Optional. Holds a flag that, if set to true, specifies that the lots consumed during a 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
Required. Holds a flag that, if set to true, specifies that the production transactions are prevented until 'acceptable' quantities of BOM components is consumed, as specified in the maxQtyPerParentItem andminQtyPerParentItem parameters. The default is false.
- constantQty
Required. Holds a flag that, if set to true, specifies that the quantity of a consumed item is independent of the quantity of a 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 BOM position is zero, this parameter is ignored.
- serialNoSource
Required. Holds a flag that, if set to true, specifies that a produced item inherits its serial numbers from this component. The default is false.
- spare1
Required. Holds the contents of the user-defined spare1 field.
- spare2
Required. Holds the contents of the user-defined spare2 field.
- spare3
Required. Holds the contents of the user-defined spare3 field.
- spare4
Required. Holds the contents of the user-defined spare4 field.
- lastEditComment
Required. Holds comments that describe why this record is being updated.
- modId
Required. Holds the modification ID assigned the last time this record was added or updated, for optimistic concurrency control. The passed value must match the record's modId for the record to be updated.
Output. Holds the new modification ID to identify this update of this record.