Skip to main content

system.mes.oee.newQualityReason

Description

Generates an empty, non-persisted Quality Reason object. This object provides the structure required to save a new quality reason record using system.mes.oee.saveQualityReason.

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newQualityReason()

Parameters

This method does not take any parameters.

Returns

A JSON representation of an OeeQualityReasonDTO object with default values, ready to be populated and saved.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the Quality Reasonnull
locationIdStringTrueIdentifier of the associated location where this quality reason appliesnull
locationPathStringTruePath of the associated location where this quality reason appliesnull
parentIdStringTrueIdentifier of the parent quality reason, if applicablenull
codeIntegerFalseUnique fault code associated with this quality reason0
nameStringFalseName of the quality reasonnull
descriptionStringTrueDescription of the quality reasonnull
pathStringTruePath representation of the quality reason within a hierarchical structurenull
notesStringTrueNotes associated with the Quality Reasonnull
enabledbooleanTrueIndicates whether the Quality Reason is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Create a new quality reason object
newReason = system.mes.oee.newQualityReason()

# Now you can set properties on the new_reason object
newReason['locationId'] = 'some-location-id'
newReason['name'] = 'Bad Packaging'

# To persist the reason, pass it to the saveQualityReason function
# savedReason = system.mes.oee.saveQualityReason(**newReason)