GetShortages(Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The GetShortages() method retrieves a list of shortage items, along with the shortage amount and its reorder quantity for each item.
For this overload of the method, the optional entity filter is identified by its entity ID.
'Declaration
Public Overloads Shared Function GetShortages( _
ByVal entId As Nullable(Of Integer) _
) As DataSet
'Usage
Dim entId As Nullable(Of Integer)
Dim value As DataSet
value = StorageExec.GetShortages(entId)
public static DataSet GetShortages(
Nullable<int> entId
)
Parameters
- entId
- Optional filter parameter. Holds the ID of an entity.
Return Value
Returns a DataSet that contains a record for each shortage item. If no matching records are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
item_id |
A string that is the ID of the item, from the Item_Process_Link table. |
|
item_desc |
A string that is the description of the item, from the Item_Process_Link table. |
|
process_id |
A string that is the ID of the process, from the Item table. |
|
min_inv_level |
A double that is the minimum inventory level, from the Item table. |
|
shortage_amt |
A double that is the shortage amount. |
|
reorder_amt |
A double that is the minimum replenishment order amount, from the Item table. |
All items for which the item.min_inv_level is not null and greater than zero, auto-reorder is set to false (item.auto_reorder=0), and the shortage amount is greater than zero are included in the returned DataSet.
The shortage amount for an item is calculated as the greater of:
(i) the difference between the overall minimum of that item (from item.min_inv_level) and the overall inventory of that item (total of the item_inv.qty_left), or
(II) the sum of the positive difference between the location specific minimum inventory levels (item_storage_exec_link.min_inv_level) and the inventory of that item stored at each such location. The shortage amount is further reduced by the current WIP for that item. The WIP is the total of (job.qty_at_start – job.qty_prod) for any final job of any work order producing that item.
The reorder amount for an item is calculated as the overall minimum reorder amount (item.min_reorder_amt) if the shortage amount is derived from term (i) above, or the largest reorder amount (item_Storage_Exec_link.reorder_amount) for an item with a shortage if the shortage amount is derived from term (ii).
If an entId is supplied, then the items in the DataSet are restricted to those manufactured by a process with a level permitting it to be instantiated (as per system attribute = 201). The DataSet is further filtered if the item is not produced at the first operation for the supplied entity or any of its ancestor entities. Also, the DataSet includes only the most preferred process for an item. If ent_id is not supplied, then a null is returned in the process_id column.