system.mes.inventory.findLots
Description
Retrieves Inventory Lots records based on the specified pagination, sort, and column constraint parameters.
Syntax
system.mes.inventory.findLots(**queryRequest)
Parameters
Using Python keyword arguments, a Query Request can be passed to the findLots function
without specifying each parameter individually. Please refer to the Query Request documentation for a list of parameters.
| Parameter | Type | Nullable | Description |
|---|---|---|---|
queryRequest | Query Request | False | A Query Request with the desired pagination, sorting, and filtering parameters. |
Returns
Returns a Query Result object with the following properties:
| Name | Type | Description |
|---|---|---|
content | List<Inventory Lots> | The list of all records found that meet the specified criteria |
totalPages | Integer | If pagination is used, this is the number of total pages of records in the database for the specified page size. |
totalElements | Long | If pagination is used, this is the number of records in the database that meet the specified criteria. |
pageSize | Integer | If pagination is used, this is the specified page size. |
pageIndex | Integer | If pagination is used, this is the specified page index. |
hasContent | Boolean | True if any records were found that meet the specified criteria. |
isFirst | Boolean | If pagination is used, this is true if the first page was returned. |
isLast | Boolean | If pagination is used, this is true if the last page was returned. |
hasNext | Boolean | If pagination is used, this is true if there is a page of content available after this one. |
hasPrevious | Boolean | If pagination is used, this is true if there is a page of content available before this one. |
Inventory Lot
| Name | Type | Description |
|---|---|---|
id | String (ULID) | Unique identifier for the inventory lot. |
notes | String | Notes associated with the inventory lot. |
enabled | Boolean | Indicates whether the inventory lot is enabled (default: true). |
spare1 | String | Extra field 1 for additional context. |
spare2 | String | Extra field 2 for additional context. |
spare3 | String | Extra field 3 for additional context. |
name | String | The name of the inventory lot. |
materialId | String (ULID) | The id of the material in the inventory lot. |
materialPath | String | The path of the material in the inventory lot. |
materialName | String | The name of the material in the inventory lot. |
materialQuantityFormat | String | The quantity format of the material in the inventory lot. |
status | LotStatus | The status of the inventory lot (default: OPEN). |
totalQuantity | Double | The total quantity of material added to the inventory lot (default: 0.0). |
unitOfMeasureId | String (ULID) | The id of the unit of measure of the material in the inventory lot. |
unitOfMeasureName | String | The name of the unit of measure of the material in the inventory lot. |
unitOfMeasureSymbol | String | The symbol of the unit of measure of the material in the inventory lot. |
expirationDate | Instant | The expected expiration date of the inventory lot. |
closedDate | Instant | The date that this inventory lot was closed. |
createdDate | Instant | The date that this inventory lot was created. |
Code Examples
Here is an example of how to use a Query Request to retrieve the first ten Inventory Lots created in 2025 sorted by their name.
# Generate the object structure for a new query request
queryRequest = system.mes.query.newQueryRequest()
# Set the basic attributes of the query request
queryRequest['pageSize'] = 10
queryRequest['pageIndex'] = 0
queryRequest['sortFields'] = ['name']
queryRequest['sortDirection'] = 'Ascending'
# Generate the object structure for a filter for the query request
filterRequest = system.mes.query.newFilterRequest()
filterRequest['field'] = 'createdDate'
filterRequest['condition'] = 'between'
filterRequest['minDateValue'] = '2025-01-01T00:00:00Z' # OR system.date.getDate(2025, 0, 1)
filterRequest['maxDateValue'] = '2026-01-01T00:00:00Z' # OR system.date.getDate(2026, 0, 1)
filters = [filterRequest]
queryRequest['filters'] = filters
# Retrieve the inventory lots that match the filter
result = system.mes.inventory.findLots(**queryRequest)
# Output the inventory lots that match the filter.
print(result)