AddProdPostExec(Int32,String,Int32,Double,String,String,Int32,DateTime,String,Nullable<Int32>,String,String,String,String,Nullable<Int32>,Nullable<Int32>,Nullable<Int32>,String,Nullable<Int32>,String,String,String,String,String,DBString,DBString,DBString,DBString,String) Method
- Last UpdatedNov 06, 2025
- 5 minute read
The AddProdPostExec() method enters production data for a given job, lot, production time and container in the production transaction table (Item_Prod) after the job has run on an entity.
This overload of the method uses the entity ID to identify entities specified for the method. It also requires the createdAtUtc parameter for specifying the time, in UTC, when production occurred.
Note: This is one of the preferred overloads of this method to use.
'Declaration
Public Overloads Shared Sub AddProdPostExec( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entId As Integer, _
ByVal qtyProd As Double, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal createdAtUtc As Date, _
ByVal itemId As String, _
ByVal reasCd As Nullable(Of Integer), _
ByVal lotNo As String, _
ByVal rawMaterialLotNo As String, _
ByVal subLotNo As String, _
ByVal rawMaterialSubLotNo As String, _
ByVal toEntId As Nullable(Of Integer), _
ByVal processed As Nullable(Of Integer), _
ByVal byproduct As Nullable(Of Integer), _
ByVal extRef As String, _
ByVal moveStatus As Nullable(Of Integer), _
ByVal genealogyId As String, _
ByVal eventId 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, _
ByVal altNo As String _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entId As Integer
Dim qtyProd As Double
Dim woId As String
Dim operId As String
Dim seqNo As Integer
Dim createdAtUtc As Date
Dim itemId As String
Dim reasCd As Nullable(Of Integer)
Dim lotNo As String
Dim rawMaterialLotNo As String
Dim subLotNo As String
Dim rawMaterialSubLotNo As String
Dim toEntId As Nullable(Of Integer)
Dim processed As Nullable(Of Integer)
Dim byproduct As Nullable(Of Integer)
Dim extRef As String
Dim moveStatus As Nullable(Of Integer)
Dim genealogyId As String
Dim eventId 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 altNo As String
JobExec.AddProdPostExec(sessionId, userId, entId, qtyProd, woId, operId, seqNo, createdAtUtc, itemId, reasCd, lotNo, rawMaterialLotNo, subLotNo, rawMaterialSubLotNo, toEntId, processed, byproduct, extRef, moveStatus, genealogyId, eventId, segmentRequirementId, segmentResponseId, comments, spare1, spare2, spare3, spare4, altNo)
public static void AddProdPostExec(
int sessionId,
string userId,
int entId,
double qtyProd,
string woId,
string operId,
int seqNo,
DateTime createdAtUtc,
string itemId,
Nullable<int> reasCd,
string lotNo,
string rawMaterialLotNo,
string subLotNo,
string rawMaterialSubLotNo,
Nullable<int> toEntId,
Nullable<int> processed,
Nullable<int> byproduct,
string extRef,
Nullable<int> moveStatus,
string genealogyId,
string eventId,
string segmentRequirementId,
string segmentResponseId,
string comments,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
string altNo
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- userId
- Required. Holds the ID of the user who is making the change.
- entId
- Required. Holds the ID of the entity.
- qtyProd
- Required. Holds the quantity being produced.
- woId
- Required. Holds the ID of the work order.
- operId
- Required. Holds the ID of the operation.
- seqNo
- Required. Holds the job sequence number.
- createdAtUtc
- Required. Holds the time (in UTC format) of production.
- itemId
- Optional. Holds the ID of the item being produced.
- reasCd
- Optional. Holds the reason code for the item being produced.
- lotNo
- Optional. Holds the lot number of the item being produced.
- rawMaterialLotNo
- Optional. Holds the raw material lot number from which this lot was produced.
- subLotNo
- Optional. Holds the sublot number of the item being produced.
- rawMaterialSubLotNo
- Optional. Holds the raw material sublot number from which this lot was produced.
- toEntId
- Optional. Holds the ID of the storage entity for this quantity produced.
- processed
- Optional. Holds a flag that, if set to true, indicates that the quantity was processed.
- byproduct
- Optional. Holds a flag that, if set to true, indicates that a by-product was produced.
- extRef
- Optional. Holds an external reference for this row.
- moveStatus
- Optional. Holds an integer that indicates the move status.
- genealogyId
- Optional. Holds the genealogy ID (for S95).
- eventId
- 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 production 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.
- altNo
- Optional. Holds the alternative number.
The low number of required parameters for this method are designed to facilitate capturing production data from the I/O system via tags as simply as possible. The createdAtUtc and job input parameters (woId, operId, seqNo) are required parameters as the production data is being entered after the fact.
Whether an existing record in the Item_Prod table is updated or a new record is added is determined as follows:
- If a record already exists for the primary key values supplied (or defaulted), then the quantity provided by this method will be added to the existing record in the Item_Prods table. In this case, the other non-defaulted dependent parameters (fromEntId, etc.) for the entire record (i.e., including previous quantities) will be changed to those specified by this call.
- If a record with the supplied primary key values does not exist, or the Maintain distinct good production records or Maintain distinct reject production records system attribute (attr_id = 362 and 309, respectively) is True, then a new record is created.
Other behaviors of this method include the following:
- When determining the job record to use, the job start time that immediately precedes the createdAtUtc time will be used and the associated shift information will be retrieved.
- If the specified job is not found to be running during the provided time, an error is returned.
- If any of the lot, container, reason code, or entity values change, then these changes are written to the Job_Bom table and used as the defaults for future transactions where the defaults are to be applied.
- If the update_inv flag is set for this produced item in the Job_Bom table, then the qty_left field in the Item_Inv table will be increased by the produced qty_prod.
- If the backflush flag is set for any of the BOM items in the Job_Bom table for this job, then a consumption transaction will be generated to consume the materials at standard rates. Similarly, if the update_inv flag is set for any of these BOM items, then inventory adjustment transactions will also be applied automatically.
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.