InventSum::findSameBatchFirstOrLargest Method
Gets an InventSum and InventDim for the same batch inventory that is first that meets the requirements or largest available for reservation, depending on parameter settings.
Syntax
server public static container findSameBatchFirstOrLargest(
InventMovement _movement,
InventDim _inventDimCriteria,
InventDimParm _inventDimParm,
[InventQty _reqQty,
PdsCWInventQty _cwReqQty])
Run On
Server
Parameters
- _movement
Type: InventMovement Class
The inventory movement.
- _inventDimCriteria
Type: InventDim Table
The criteria to limit the batch search to.
- _inventDimParm
Type: InventDimParm Table
The flags for the inventory dimension criteria values.
- _reqQty
Type: InventQty Extended Data Type
The required minimum inventory quantity that a batch must have; optional. If specified this method will search for a batch that has at least this inventory quantity available.
- _cwReqQty
Type: PdsCWInventQty Extended Data Type
The required minimum catch weight quantity that a batch must have; optional. If specified this method will search for a batch that has at least this catch weight quantity available.
Return Value
Type: container
A container with two values: the InventSum record and the InventDim record found by the search. If there is no batch found with available inventory for reservation that is enough for the required quantity, then the largest available will be returned. If there is no inventory found matching the item and dimension criteria then the two record buffers will be empty.
Remarks
The selection of the actual batch depends on the reservation settings in the inventory model group (ReserveByDate and FEFO). If either of these are set, meaning date dependent reservation is selected; and if _reqQty or _cwReqQty are either non-zero, then the first batch that matches that requirement is returned. Otherwise, this will find the batch with the largest available inventory available for reservation that matches the given item and dimension selection parameters.