Skip to main content

system.mes.oee.splitOeeWasteRecord

Description

Splits an OEE Waste Record at a specified time. This action modifies the original record, shortening its duration, and creates a new record for the remaining time.

If newWasteCount is provided, the new record will be assigned that waste count and the original record's waste count will be reduced by the same amount. If newWasteCount is not provided, the waste count is distributed proportionally based on the duration of each resulting record.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.splitOeeWasteRecord(oeeWasteRecordId, splitDate, newWasteCount=None)

Parameters

ParameterTypeNullableDescription
oeeWasteRecordIdString (ULID)FalseThe ID of the OEE waste record to split.
splitDateDateFalseThe date and time at which to split the record.
newWasteCountDoubleTrueThe waste count to assign to the new record. If None, waste count is distributed proportionally by duration.

Returns

Returns a JSON representation of the new OeeWasteRecordDTO object that was split off from the original OEE waste record.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Waste Recordnull
locationIdStringFalseIdentifier of the associated location where this OEE waste record was capturednull
locationPathStringTruePath of the location where this OEE waste record was capturednull
locationNameStringTrueName of the associated locationnull
startDateInstantFalseStart date and time of the OEE waste recordInstant.now()
endDateInstantTrueEnd date and time of the OEE waste recordnull
totalDurationSecDoubleFalseTotal duration of the OEE waste record in seconds0.0
qualityReasonIdStringTrueIdentifier of the associated quality reason, if applicablenull
qualityReasonNameStringTrueName of the associated quality reason. (Name - Code) For display purposes onlynull
qualityReasonPathStringTruePath to the current quality reasonnull
qualityReasonCodeStringTrueCode of the associated quality reasonnull
wasteCountDoubleFalseTotal number of waste units recorded during this period0.0
wasteCountUnitOfMeasureIdStringTrueIdentifier of the unit of measure for the waste countnull
wasteCountUnitOfMeasureNameStringTrueName of the unit of measure for the waste countnull
wasteCountUnitOfMeasureSymbolStringTrueSymbol of the unit of measure for the waste countnull
notesStringTrueNotes associated with the OEE Waste Recordnull
enabledbooleanTrueIndicates whether the OEE Waste Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Split an OEE waste record at a specific date
splitDate = "2025-09-05 14:58:30"
splitDate = system.date.parse(splitDate, "yyyy-MM-dd HH:mm:ss")

system.mes.oee.splitOeeWasteRecord(
'01JAP8RJBN-8ZTPXSGY-J9GSDPE1',
splitDate
)

# Split an OEE waste record and assign a specific waste count to the new record
system.mes.oee.splitOeeWasteRecord(
'01JAP8RJBN-8ZTPXSGY-J9GSDPE1',
splitDate,
newWasteCount=5.0
)