Skip to main content

system.mes.oee.newPerformanceReason

Description

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

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newPerformanceReason()

Parameters

This method does not take any parameters.

Returns

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

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

Code Examples

# Create a new performance reason object
newReason = system.mes.oee.newPerformanceReason()

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

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