SetCurLotDataAsync Method
- Last UpdatedNov 06, 2025
- 3 minute read
The SetCurLotDataAsync() method sets the current lot information for the running job.
This overload of the method uses the entity name and site name to specify the entity.
'Declaration
Public Shared Sub SetCurLotDataAsync( _
ByVal sessionId As Integer, _
ByVal eventTime As Nullable(Of Date), _
ByVal userId As String, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal bomPos As Nullable(Of Integer), _
ByVal curItemId As String, _
ByVal curLotNo As String, _
ByVal curSubLotNo As String, _
ByVal curReasCd As Nullable(Of Integer), _
ByVal curStorageEntName As String, _
ByVal curStorageSiteName As String, _
ByVal curUpdateInv As Nullable(Of Boolean), _
ByVal curBackFlush As Nullable(Of Boolean), _
ByVal jobPos As Nullable(Of 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 bomPos As Nullable(Of Integer)
Dim curItemId As String
Dim curLotNo As String
Dim curSubLotNo As String
Dim curReasCd As Nullable(Of Integer)
Dim curStorageEntName As String
Dim curStorageSiteName As String
Dim curUpdateInv As Nullable(Of Boolean)
Dim curBackFlush As Nullable(Of Boolean)
Dim jobPos As Nullable(Of Integer)
JobExec.SetCurLotDataAsync(sessionId, eventTime, userId, entName, siteName, bomPos, curItemId, curLotNo, curSubLotNo, curReasCd, curStorageEntName, curStorageSiteName, curUpdateInv, curBackFlush, jobPos)
public static void SetCurLotDataAsync(
int sessionId,
Nullable<DateTime> eventTime,
string userId,
string entName,
string siteName,
Nullable<int> bomPos,
string curItemId,
string curLotNo,
string curSubLotNo,
Nullable<int> curReasCd,
string curStorageEntName,
string curStorageSiteName,
Nullable<bool> curUpdateInv,
Nullable<bool> curBackFlush,
Nullable<int> jobPos
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the call is being made.
- eventTime
- Optional. Holds the event time.
- userId
- Required. Holds the ID of the user.
- entName
- Required. Holds the name of the entity.
- siteName
- Optional. Holds the site name of the entity
- bomPos
Optional. Holds the BOM position.
0 for the current main production item (the default).
> 0 for consumption items to identify the BOM component.
< 0 for by-products to identify the by-product.
- curItemId
- Optional. Holds the ID of the new item being produced or consumed for this BOM position on this entity. If omitted, the current value is not affected. This allows the current item to be changed during production if required.
- curLotNo
- Optional. Holds the new lot number for this BOM position on this entity. If omitted, the current value is not affected.
- curSubLotNo
- Optional. Holds the sublot number for the item.
- curReasCd
- Optional. Holds the new reason code (production or consumption code or waste/reject reason) for this BOM position on this entity. If omitted, the current value is not affected.
- curStorageEntName
- Optional. Holds the name of the storage entity produced to or consumed from for this BOM position on this entity. If omitted, the current value is not affected.
- curStorageSiteName
- Optional. Holds the site name for the storage entity.
- curUpdateInv
- Optional. Holds a boolean value to flag whether quantities produced or consumed at this BOM position on this entity should update inventory quantities or not. If omitted the current value is not affected.
- curBackFlush
- Optional. Holds information about whether consumption is being back flushed or not.
- jobPos
- Optional. Holds the job position. If greater than 1, jobs are running on this entity
This method is useful when quantities are received directly from PLCs on the production line, but the lot numbers, containers, etc., are specified independently of those counters.
This method does not add any production quantities. It just sets the current values so that the next time quantities are received via the AddProd() method, these values are applied (assuming they are not specified in the AddProd() method, in which case the specified values take precedence and replace these).
This method updates the values even if no job is currently running on the entity. However, when a job is started, it may have values defined that automatically set these values for that particular job. Thus its real benefit is modifying all or some of these values once a job is running on an entity.