Skip to main content

system.mes.oee.updateOeeModeRecordMode

Description

Updates the mode of an existing OEE Mode Record.

Copies the code, name, calculation type, color, from the OEE Mode to the OEE Mode Record.

Permissions

This method requires the SYSTEM.ADMIN permission.

Syntax

system.mes.oee.updateOeeModeRecordMode(oeeModeRecordId, newOeeModeId, newExpectedDurationSec)

Parameters

ParameterTypeNullableDescription
oeeModeRecordIdString (ULID)FalseThe ID of the OEE Mode Record to update.
newOeeModeIdString (ULID)FalseThe ID of the new OEE Mode to set.
newExpectedDurationSecDoubleTrueNew expected duration in seconds to set on the OEE Mode Record.

Returns

Returns a JSON representation of the updated OeeModeRecordDTO object.

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 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

Code Examples

oeeModeRecordId = "01JPWSRZPB-F5DR287Y-FPHMHHY1"  
newOeeModeId = "01JPWST278-J1K1GK0J-DNAD02QW"
newExpectedDurationSec = 3600 # 1 hour

system.mes.oee.updateOeeModeRecordMode(oeeModeRecordId, newOeeModeId, newExpectedDurationSec)