RejectProd(Int32,Int32,Double,Int32,String,String,String,String,String,String,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The RejectProd() method marks previously reported production as rejected.
This overload of the method uses the entity ID to specify the entities.
'Declaration
Public Overloads Shared Sub RejectProd( _
ByVal sessionId As Integer, _
ByVal rowId As Integer, _
ByVal rejectQty As Double, _
ByVal newReasCd As Integer, _
ByVal newItemId As String, _
ByVal newLotNo As String, _
ByVal newRmLotNo As String, _
ByVal newSubLotNo As String, _
ByVal newRmSubLotNo As String, _
ByVal newUserId As String, _
ByVal newToEntId As Nullable(Of Integer) _
)
'Usage
Dim sessionId As Integer
Dim rowId As Integer
Dim rejectQty As Double
Dim newReasCd As Integer
Dim newItemId As String
Dim newLotNo As String
Dim newRmLotNo As String
Dim newSubLotNo As String
Dim newRmSubLotNo As String
Dim newUserId As String
Dim newToEntId As Nullable(Of Integer)
JobExec.RejectProd(sessionId, rowId, rejectQty, newReasCd, newItemId, newLotNo, newRmLotNo, newSubLotNo, newRmSubLotNo, newUserId, newToEntId)
public static void RejectProd(
int sessionId,
int rowId,
double rejectQty,
int newReasCd,
string newItemId,
string newLotNo,
string newRmLotNo,
string newSubLotNo,
string newRmSubLotNo,
string newUserId,
Nullable<int> newToEntId
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the call is being made.
- rowId
- Required. Holds the row ID of the existing Item_Prod record.
- rejectQty
- Required. Holds the reject quantity. Must be less than or equal to the current quantity for this record.
- newReasCd
- Required. Holds the reason code for the rejected quantity.
- newItemId
- Optional. Holds the ID of the new item. Defaults to the value in the existing record.
- newLotNo
- Optional. Holds the new lot number for the quantity produced. Defaults to the value in the existing record.
- newRmLotNo
- Optional. Holds the lot number of the new rejected material.
- newSubLotNo
- Optional. Holds the new sublot number for the quantity produced. Defaults to the value in the existing record.
- newRmSubLotNo
- Optional. Holds the sublot number of the new rejected material.
- newUserId
- Optional. Holds the ID of the user to which to change the rejected quantity. Defaults to the value in the existing record.
- newToEntId
- Optional. Holds the ID of the new storage entity for the split quantity. Defaults to the value in the existing record.
The required fields identify the current record and the quantity to be rejected. The rejected quantity must be less than or equal to the qty_prod value in the existing record. Rejecting the full quantity is equivalent to simply updating the existing record. Otherwise a new record is created for the rejected quantities with the rejected grade and status, and the quantity for the existing record is reduced by the amount rejected.
For the method to succeed, the newReasCd and newItemId values must exist in the database. The newReasCd will be used to determine the grade_cd, status_cd, and good_prod flag for the split record (or updated record if rejecting the whole quantity).
All optional fields default to the values in the existing record if they are not included.
If a record already exists in the database for the rejected record, then the rejected quantity will simply be added to the existing record. If any other optional dependent fields are specified, then they will also be changed for the rejected record. If the quantity of the existing record (not the rejected record) is reduced to zero, the existing record is deleted.