Skip to main content

system.mes.material.exportMaterialsAsJson

Description

Exports all Materials as a JSON string (UTF-8 encoded). Streams material data from the database and formats it as a JSON string, including a header row.

Syntax

system.mes.material.exportMaterialsAsJson()

Parameters

No parameters.

Returns

All materials as a JSON string (UTF-8 encoded).

Code Examples

Perspective

jsonString = system.mes.material.exportMaterialsAsJson()
system.perspective.download("materials.json", jsonBytes)

Script Console

jsonString = system.mes.material.exportMaterialsAsJson()
path = system.file.saveFile("materials.json")
if path is not None:
system.file.writeFile(path, jsonString)