Skip to main content

system.mes.material.getMaterialReasonCode

Description

Retrieves a Material Reason Codes record by its ID or reason code.

Syntax

system.mes.material.getMaterialReasonCode(materialReasonCodeIdOrCode)

Parameters

ParameterTypeDescription
materialReasonCodeIdOrCodeStringThe ID or reason code of the material reason code to retrieve.

Returns

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

NameTypeDescription
lotRecordTypeStringThe action that was taken on a lot.
reasonCodeStringThe unique code identifying the reason for material handling.
descriptionStringThe detailed description of the reason for the material activity.
requireCommentsBooleanIndicates whether additional comments are required when using this reason code.
idString (ULID)The ULID of the material reason code.
enabledBooleanIndicates if the material reason code is active and enabled.
createdDateInstantThe creation date of the material reason code.
createdByStringThe person that created this material reason code.
modifiedDateInstantThe modified date of the material reason code.
modifiedByStringThe person that modified this material reason code.
notesStringNotes related to the material reason code.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Retrieve a material reason code by ID or reason code
material_reason_code = system.mes.material.getMaterialReasonCode('SCRP001')

# Output the material reason code
print(material_reason_code)