AddCons(Int32,Nullable<DateTime>,String,String,String,String,String,Int32,Int32,Double,Nullable<Int32>,String,String,String,String,String,String,String,String,Nullable<Boolean>,String,String,String,String,String,DBString,DBString,DBString,DBString,Int32) Method
- Last UpdatedNov 06, 2025
- 4 minute read
The AddCons() method adds consumption for the specified BOM item for the job running on the current job position.
This overload of the method uses the entity name and entity site name to identify entities specified for the method. It also includes the optional eventTime input parameter and the optional woId, operId, and seqNo parameters, which can be used to specify a job.
'Declaration
Public Overloads Shared Sub AddCons( _
ByVal sessionId As Integer, _
ByVal eventTime As Nullable(Of Date), _
ByVal userId As String, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal bomPos As Integer, _
ByVal qtyCons As Double, _
ByVal reasCd As Nullable(Of Integer), _
ByVal lotNo As String, _
ByVal fgLotNo As String, _
ByVal subLotNo As String, _
ByVal fgSubLotNo As String, _
ByVal fromEntName As String, _
ByVal fromSiteName As String, _
ByVal itemId As String, _
ByVal extRef As String, _
ByVal applyScalingFactor As Nullable(Of Boolean), _
ByVal genealogyId As String, _
ByVal upstreamEventId As String, _
ByVal segmentRequirementId As String, _
ByVal segmentResponseId As String, _
ByVal comments As String, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByRef rowId As Integer _
)
'Usage
Dim sessionId As Integer
Dim eventTime As Nullable(Of Date)
Dim userId As String
Dim entName As String
Dim siteName As String
Dim woId As String
Dim operId As String
Dim seqNo As Integer
Dim bomPos As Integer
Dim qtyCons As Double
Dim reasCd As Nullable(Of Integer)
Dim lotNo As String
Dim fgLotNo As String
Dim subLotNo As String
Dim fgSubLotNo As String
Dim fromEntName As String
Dim fromSiteName As String
Dim itemId As String
Dim extRef As String
Dim applyScalingFactor As Nullable(Of Boolean)
Dim genealogyId As String
Dim upstreamEventId As String
Dim segmentRequirementId As String
Dim segmentResponseId As String
Dim comments As String
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim rowId As Integer
JobExec.AddCons(sessionId, eventTime, userId, entName, siteName, woId, operId, seqNo, bomPos, qtyCons, reasCd, lotNo, fgLotNo, subLotNo, fgSubLotNo, fromEntName, fromSiteName, itemId, extRef, applyScalingFactor, genealogyId, upstreamEventId, segmentRequirementId, segmentResponseId, comments, spare1, spare2, spare3, spare4, rowId)
public static void AddCons(
int sessionId,
Nullable<DateTime> eventTime,
string userId,
string entName,
string siteName,
string woId,
string operId,
int seqNo,
int bomPos,
double qtyCons,
Nullable<int> reasCd,
string lotNo,
string fgLotNo,
string subLotNo,
string fgSubLotNo,
string fromEntName,
string fromSiteName,
string itemId,
string extRef,
Nullable<bool> applyScalingFactor,
string genealogyId,
string upstreamEventId,
string segmentRequirementId,
string segmentResponseId,
string comments,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
out int rowId
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- eventTime
- Optional. Holds the event time.
- userId
- Required. Holds the user ID of the user who is making the change.
- entName
- Required. Holds the name of the entity.
- siteName
- Optional. Holds the site name of the entity.
- woId
- Optional. Holds the ID of the work order for which the item is being consumed.
- operId
- Optional. Holds the ID of the operation for which the item is being consumed.
- seqNo
- Optional. Holds the sequence number of the job for which the item is being consumed.
- bomPos
- Required. Holds the BOM position of the item that is being consumed.
- qtyCons
- Required. Holds the quantity being consumed.
- reasCd
- Optional. Holds the reason code for the item that is being consumed.
- lotNo
- Optional. Holds the the lot number of the item that is being consumed.
- fgLotNo
- Optional. Holds the finished goods lot number of the item that is being consumed.
- subLotNo
- Optional. Holds the sublot number.
- fgSubLotNo
- Optional. Holds the goods sublot number of the item that is being consumed.
- fromEntName
- Optional. Holds the name of the storage entity.
- fromSiteName
- Optional. Holds the site name of the storage entity.
- itemId
- Optional. Holds the ID of the item that is being consumed.
- extRef
- Optional. Holds the external reference of the item that is being consumed.
- applyScalingFactor
- Optional. Holds the scaling factor.
- genealogyId
- Optional. Holds the genealogy ID (for S95).
- upstreamEventId
- Optional. Holds the upstream event ID (for S95).
- segmentRequirementId
- Optional. Holds the segment requirement ID (for S95).
- segmentResponseId
- Optional. Holds the segment response ID (for S95).
- comments
- Optional. Holds comments about the consumption that is being added.
- 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.
- rowId
- Output. The returned row_id of the record that is added or updated if this call is successful.