GetAvailLots(String,String,Int32,String,String) Method
- Last UpdatedNov 06, 2025
- 4 minute read
The GetAvailLots() method retrieves all eligible lots for a job running on the specified entity.
This overload of the method uses the entity name and site name to identify the entity.
public static DataSet GetAvailLots(
string woId,
string operId,
int seqNo,
string entName,
string siteName
)
Parameters
- woId
- Required. Holds the work order ID of the job.
- operId
- Required. Holds the operation ID of the job.
- seqNo
- Required. Holds the sequence number of the job.
- entName
- Required. Holds the name of the entity that is running the job whose available lots are being retrieved.
- siteName
- Optional. Holds the site name of the entity.
Return Value
Returns a DataSet that contains all the eligible lots for a given job running on the supplied entity. If no eligible lots are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
lot_no |
A string that is the lot number, from the Item_Prod, Item_Cons, Job_Step_Data, Item_Inv, or Job_Bom table. |
If the supplied job is configured NOT to consume from WIP inventory (job_bom.must_consume_from_wip is set to false), then the lots included from each case below is as follows:
- Any serialized item that is produced to a lot from the supplied job that is immediately upstream to it is excluded (item_prod.lot_no).
- Lots that are produced by the serialized item from the supplied job are included (item_prod.lot_no) in the returned DataSet.
- Any finished goods lot number (item_cons.fg_lot_no) while consuming an item for this job are included in the returned DataSet
- Any lot number that was started/finished for a step (job_step_data.lot_no), but that does not have any users actively logged on to any steps for them on a different entity, are included.
- All lot numbers from the inventory linking the supplied job (item_inv.lot_no) are included.
- The default lot number assigned to this job (job_bom.def_lot_no whose BOM position is 0) for the produced item is included.
- Lot numbers from the Assigned_Lot table that are unstarted, are for the current work order, and are not for a different operation or sequence number other than the current job are included
- Those lot numbers that are assigned to an item in the Assigned_Lot table whose status is not set to done (=2), are for the current work order and operation, and do not have any users actively logged onto any steps for them on a different entity, are included.
If the supplied job is configured to consume from WIP inventory (job_bom.must_consume_from_wip is set to true), then the supplied work order is checked to determine whether the job routes can be overridden. If the job routes cannot be overridden, then the Middleware determines whether the user (from the context of a calling session) has a privilege to override the job route. If the job route for the supplied work order is configured to be overridden (wo.may_override_route is set to true) or the user has a privilege “May override hard pegged and linear flow” to override the route, then the lot numbers are returned as follows:
- Lots of this item produced by the supplied work order are included.
- The lot numbers in inventory for the supplied entity and its immediate parents that can store, and any movable storage entities that are located at (directly or indirectly) the supplied entity or its immediate parents regardless of the job that produced this serial number, that are produced by the supplied work order, are included.
- Those lot numbers that are assigned to an item (in the Assigned_Lot table), but are not started/unstarted (assigned_lot.status = 0), and are for the current work order, and are not for a different operation or sequence number than the current job, are included.
If the work order is configured not to override the route, and the current user (from the context of a calling session) does not have a privilege “May override hard pegged and linear flow” to override the route, then the lot numbers are returned as follows:
- Lots of this item produced by the supplied work order are included.
- The lot numbers in inventory for the supplied entity and its immediate parents that can store, and any movable storage entities that are located at (directly or indirectly) the supplied entity or its immediate parents are included if these lot numbers come from a job that produces this item which is immediately upstream to the supplied job.
- Those lot numbers that are assigned to an item (in the Assigned_Lot table), but are not started/unstarted (assigned_lot.status = 0), and are for the current work order, and are not for a different operation or sequence number than the current job, are included.