Skip to main content

system.mes.oee.newDowntimeReason

Description

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

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newDowntimeReason()

Parameters

This method does not take any parameters.

Returns

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

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

Code Examples

# Create a new downtime reason object
newReason = system.mes.oee.newDowntimeReason()

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

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