Skip to main content

system.mes.material.getMaterialByErpId

Description

Retrieves a Materials record given an erp ID.

Syntax

system.mes.material.getMaterialByErpId(erpId)

Parameters

ParameterTypeDescription
erpIdString (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.

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 with the given erp ID
material = system.mes.material.getMaterialByErpId('1030-8450-01')

# Output the material
print(material)