Skip to main content

system.mes.inventory.operation.exportAsCsv

Description

No Parameter:

Exports all Inventory Operations as raw CSV bytes (UTF-8 encoded). Streams inventory operation data from the database and formats it as CSV, including a header row.

With a Parameter:

Exports selected Inventory Operations associated with the specified location ids or paths as raw CSV bytes (UTF-8 encoded). Streams inventory operation data from the database and formats it as CSV, including a header row.

Syntax

system.mes.inventory.operation.exportAsCsv()
system.mes.inventory.operation.exportAsCsv(locationIdOrPaths)

Parameters

ParameterTypeNullableDescription
None--This function does not take any parameters.

With a Parameter:

ParameterTypeNullableDescription
locationIdOrPathsPyListTrueList of location ids or paths used to determine which associated inventory operations will be exported.

Returns

A byte array (byte[]) containing the raw CSV export data.

Code Examples

Perspective

csvBytes = system.mes.inventory.operation.exportAsCsv()
system.perspective.download("inventory_operations.csv", csvBytes)

Script Console

csvBytes = system.mes.inventory.operation.exportAsCsv()
path = system.file.saveFile("inventory_operations.csv")
if path is not None:
system.file.writeFile(path, csvBytes)