Skip to main content

system.mes.oee.setPerformanceReasonForProductionRecord

Description

Sets a performance reason for a specific OEE production record, with optional notes.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.setPerformanceReasonForProductionRecord(oeeProductionRecordId, performanceReasonId=None, notes=None)

Parameters

ParameterTypeNullableDescription
oeeProductionRecordIdStringFalseThe ID of the OEE production record to update.
performanceReasonIdStringTrueThe ID of the performance reason to assign. Set to None to clear.
notesStringTrueOptional notes to add to the production record.

Returns

A JSON representation of the updated OeeProductionRecordDTO object.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Production Recordnull
locationIdStringFalseIdentifier of the associated location where this OEE production record was capturednull
locationPathStringTruePath of the location where this OEE production record was capturednull
locationNameStringTrueName of the associated locationnull
statusStatusFalseStatus of the OEE production record (e.g., running, faulted, canceled, complete)UNKNOWN
startDateInstantFalseStart date and time of the OEE production recordInstant.now()
endDateInstantTrueEnd date and time of the OEE production recordnull
totalDurationSecDoubleFalseTotal duration of the OEE production record in seconds0.0
performanceReasonIdStringTrueIdentifier of the associated performance reason, if applicablenull
performanceReasonNameStringTrueName of the associated performance reason. (Name - Code) For display purposes onlynull
performanceReasonPathStringTruePath to the current performance reasonnull
infeedCountDoubleFalseTotal number of infeed units during this record period0.0
expectedInfeedCountDoubleFalseExpected number of infeed units during this record period0.0
qualityStrategyOeeQualityStrategyFalseQuality Strategy for this OEE Production RecordWASTE_COUNT
outfeedCountDoubleFalseTotal number of outfeed units recorded during this period0.0
infeedCountUnitOfMeasureIdStringTrueIdentifier of the unit of measure for the infeed countnull
infeedCountUnitOfMeasureNameStringTrueName of the unit of measure for the infeed countnull
infeedCountUnitOfMeasureSymbolStringTrueSymbol of the unit of measure for the infeed countnull
infeedRateTimeUnitsTimeUnitFalseUnit of measure for the machine infeed rate & standard rateMINUTES
stateRecordIdStringTrueIdentifier of the associated state recordnull
standardRateDoubleTrueThe standard rate for this record0.0
productionOrderIdStringTrueThe id of the production order associated with this OEE production recordnull
productionOrderNameStringTrueThe name of the production order associated with this OEE production recordnull
notesStringTrueNotes associated with the OEE Production Recordnull
enabledbooleanTrueIndicates whether the OEE Production Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Assume we have a production record ID and a reason ID
productionRecordId = "someProductionRecordId"
reasonId = "some-performance-reason-id"

# Set the performance reason and add a note
try:
updatedRecord = system.mes.oee.setPerformanceReasonForProductionRecord(
oeeProductionRecordId=productionRecordId,
performanceReasonId=reasonId,
notes="Operator confirmed speed reduction due to material variability."
)
print "Successfully updated production record:", updatedRecord['id']
print "New Reason:", updatedRecord['performanceReasonName']

except Exception as e:
print "Error updating production record:", str(e)

# To clear a performance reason
# system.mes.oee.setPerformanceReasonForProductionRecord(productionRecordId, None, "Reason cleared.")