Skip to main content

system.mes.oee.setOeeModeRecordNotesAndSpares

Description

Sets comment fields (notes, spare1, spare2, spare3) for an OEE Mode Record.

Accepts a full OeeModeRecordDTO but only updates the notes and spare fields.

The record is fetched fresh from the database by ID.

Recommended to call with setOeeModeRecordNotesAndSpares(**oeeModeRecord) where oeeModeRecord is an OeeModeRecordDTO object.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.setOeeModeRecordNotesAndSpares(**oeeModeRecord)

Parameters

An unpacked dictionary of OeeModeRecordDTO fields.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Mode Recordnull
locationIdStringFalseIdentifier of the associated location where this mode was recordednull
locationNameStringTrueName of the associated locationnull
locationPathStringTruePath of the associated location where this mode was recordednull
codeIntegerFalseInteger mode numbernull
statusStatusFalseStatus of the OEE production record (running, faulted, cancelled, complete etc.)UNKNOWN
startDateInstantFalseStart date and time of the mode recordInstant.now()
endDateInstantTrueEnd date and time of the mode recordnull
durationDoubleFalseTotal duration of the mode record in seconds0.0
overrunDurationSecDoubleFalseDuration in seconds that the machine has overrun its scheduled downtime0.0
nameStringFalseName of the modenull
calculationTypeOeeModeCalculationTypeFalseSpecifies how this mode should be factored into OEE calculationsSCHEDULED_PRODUCTION
colorStringFalseHex color code representing the mode visually"#000000"
expectedDurationDoubleTrueExpected duration of the mode in seconds0.0
notesStringTrueNotes associated with the OEE Mode Recordnull
enabledbooleanTrueIndicates whether the OEE Mode Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Returns

Returns a JSON representation of the updated OeeModeRecordDTO object.

Code Examples

# Retrieve an OEE mode record by ID
oeeModeRecord = system.mes.oee.getOeeModeRecord('01JAP8RJBN-8ZTPXSGY-J9GSDPE1')

# Change mode record notes
oeeModeRecord['notes'] = 'Changed notes'

# Update OEE mode record notes
system.mes.oee.setOeeModeRecordNotesAndSpares(**oeeModeRecord)