AddConsDirect Method
- Last UpdatedNov 06, 2025
- 3 minute read
The AddConsDirect() method adds consumption information directly for an item, not necessarily through a job that has run on an entity. This means that consumption can be added to the item even if there is no job that produces this identified item.
'Declaration
Public Shared Sub AddConsDirect( _
ByVal userId As String, _
ByVal fromEntId As Integer, _
ByVal itemId As String, _
ByVal qtyCons As Double, _
ByVal reasCd As Integer, _
ByVal gradeCd As Integer, _
ByVal statusCd As Integer, _
ByVal lotNo As String, _
ByVal shiftId As Integer, _
ByVal shiftStart As String, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal entId As Integer, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal item_scrapped As Integer _
)
public static void AddConsDirect(
string userId,
int fromEntId,
string itemId,
double qtyCons,
int reasCd,
int gradeCd,
int statusCd,
string lotNo,
int shiftId,
string shiftStart,
string woId,
string operId,
int seqNo,
int entId,
string spare1,
string spare2,
string spare3,
string spare4,
int item_scrapped
)
Parameters
- userId
- Required. Holds the ID of the user to whom to attribute the consumption.
- fromEntId
- Required. Holds the ID of the storage entity from which the quantity was consumed.
- itemId
- Required. Holds the ID of the item that is being consumed.
- qtyCons
- Required. Holds the consumption quantity being added.
- reasCd
- Required. Holds the reason code of the item being consumed.
- gradeCd
- Required. Holds an item grade for the quantity consumed. Set to -1 if not used.
- statusCd
- Required. Holds the item status for the quantity consumed. Set to -1 if not used.
- lotNo
- Optional. Holds the lot number for the item that is being consumed. Set to null if not used.
- shiftId
- Optional. Holds the ID of the shift in which this item was consumed. Set to -1 if not used.
- shiftStart
- Optional. Holds the start of the shift in which this item was consumed. Set to null if not used.
- woId
- Optional. Holds the work order ID of a job by which the item was consumed. Set to null if not used.
- operId
- Optional. Holds the operation ID of a job by which the item was consumed. Set to null if not used.
- seqNo
- Optional. Holds the sequence number of a job by which the item was consumed. Set to -1 if not used.
- entId
- Optional. Holds the ID of the entity on which the job by which the item was consumed was run. Set to -1 if not used.
- spare1
- Optional. Holds a value for the spare1 field of the job. Set to null if not used.
- spare2
- Optional. Holds a value for the spare2 field of the job. Set to null if not used.
- spare3
- Optional. Holds a value for the spare3 field of the job. Set to null if not used.
- spare4
- Optional. Holds a value for the spare4 field of the job. Set to null if not used.
- item_scrapped
- Required. Holds a 0 or 1 flag to signal scrap; that is, item was consumed as scrap.