Skip to main content

system.mes.material.getMaterial

Description

Retrieves a Materials record by its ID or path.

Syntax

system.mes.material.getMaterial(idOrPath)

Parameters

ParameterTypeDescription
idOrPathStringThe ID or path of the material to retrieve.

Returns

Returns a JSON representation of the material. Returns nothing if no material is found.

NameTypeDescription
nameStringThe name of the material.
descriptionStringThe description of the material.
pathStringThe path to the material.
materialClassIdString (ULID)The ULID of the material class associated with this material.
erpIdString (ULID)The ULID of the erp associated with this material.
unitOfMeasureIdString (ULID)The ULID of the unit of measure associated with this material.
shelfLifeDaysIntegerThe shelf life in days of this material.
idString (ULID)The ULID of the material.
notesStringNotes related to the material.
enabledBooleanIndicates if the material is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Retrieve a material by ID or path
material = system.mes.material.getMaterial('IRB/5391537510212')

# Output the material
print(material)