system.mes.inventory.operation.exportAsJson
Description
No Parameter:
Exports all Inventory Operations as raw JSON bytes (UTF-8 encoded). Streams inventory operation data from the database and formats it as JSON.
With a Parameter:
Exports selected Inventory Operations associated with the specified location ids or paths as raw JSON bytes (UTF-8 encoded). Streams inventory operation data from the database and formats it as JSON.
Syntax
system.mes.inventory.operation.exportAsJson()
system.mes.inventory.operation.exportAsJson(locationIdOrPaths)
Parameters
Parameter | Type | Nullable | Description |
---|---|---|---|
None | - | - | This function does not take any parameters. |
With a Parameter:
Parameter | Type | Nullable | Description |
---|---|---|---|
locationIdOrPaths | PyList | True | List of location ids or paths used to determine which associated inventory operations will be exported. |
Returns
A byte array (byte[]) containing the raw JSON export data.
Code Examples
Perspective
jsonBytes = system.mes.inventory.operation.exportAsJson()
system.perspective.download("inventory_operations.json", jsonBytes)
Script Console
jsonBytes = system.mes.inventory.operation.exportAsJson()
path = system.file.saveFile("inventory_operations.json")
if path is not None:
system.file.writeFile(path, jsonBytes)