Skip to main content

system.mes.oee.newAvailabilityReason

Description

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

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newAvailabilityReason()

Parameters

This method does not take any parameters.

Returns

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

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

Code Examples

# Create a new availability reason object
newReason = system.mes.oee.newAvailabilityReason()

# 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 saveAvailabilityReason function
# savedReason = system.mes.oee.saveAvailabilityReason(**newReason)