system.mes.material.getMaterialByErpId
Description
Retrieves a Materials record given an erp ID.
Syntax
system.mes.material.getMaterialByErpId(erpId)
Parameters
Parameter | Type | Description |
---|---|---|
erpId | String (ULID) | The ID of the erp associated with the material to retrieve. |
Returns
Returns a JSON representation of the material. Returns nothing if no material is found.
Name | Type | Description |
---|---|---|
name | String | The name of the material. |
description | String | The description of the material. |
path | String | The path to the material. |
materialClassId | String (ULID) | The ULID of the material class associated with this material. |
erpId | String (ULID) | The ULID of the erp associated with this material. |
unitOfMeasureId | String (ULID) | The ULID of the unit of measure associated with this material. |
shelfLifeDays | Integer | The shelf life in days of this material. |
id | String (ULID) | The ULID of the material. |
notes | String | Notes related to the material. |
enabled | Boolean | Indicates if the material is active and enabled. |
spare1 | String | Additional field for user-defined context. |
spare2 | String | Additional field for user-defined context. |
spare3 | String | Additional field for user-defined context. |
Code Examples
# Retrieve a material with the given erp ID
material = system.mes.material.getMaterialByErpId('1030-8450-01')
# Output the material
print(material)