system.mes.productionOrder.exportPropertiesAsCsv
Description
Exports all or selected production order properties as raw bytes in CSV format (UTF-8 encoded).
Streams production order property data from the database and formats it as CSV, including a header row.
When idsOrNames is omitted, all production order properties are exported.
Permissions
This method requires the PRODUCTION_ORDER.READ.GET permission.
Syntax
system.mes.productionOrder.exportPropertiesAsCsv()
system.mes.productionOrder.exportPropertiesAsCsv(idsOrNames=["Priority"])
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idsOrNames | String[] | Yes | The ids or names of the production order properties to export. Omit to export all. |
Returns
A byte array (byte[]) containing the raw byte data of the CSV export.
Code Examples
Perspective
csvBytes = system.mes.productionOrder.exportPropertiesAsCsv()
system.perspective.download("production-order-properties.csv", csvBytes)
Script Console
csvBytes = system.mes.productionOrder.exportPropertiesAsCsv()
path = system.file.saveFile("production-order-properties.csv")
if path is not None:
system.file.writeFile(path, csvBytes)