Building a simple Query object
Sometimes, it is necessary to quickly retrieve detailed information from one or more ledgers that may contain hundreds of thousands to many millions of records. The Query object is the perfect tool for such a data selection as it is totally scalable and can retrieve the selected fields from multiple tables at once. The following example (using Cronus data) will show the aggregated quantity per bin of the lot-tracked items in stock. This query could be presented to a user by means of either a report or a page.
First, it is necessary to know what inventory is in stock and contains a lot number. This is accomplished using the Item Ledger Entry table. However, the Item Ledger Entry record does not contain any bin information. This information is stored in the Warehouse Ledger Entry table. The Location Code, Item No., and Lot No. are used to match the Item Ledger Entry and Warehouse Ledger Entry records to make sure the correct items are selected. In order...