Skip to main content
Version: V2 (Ignition 8.1)

system.mes.inventory.setInventoryMetadata

Description​

Updates the metadata for a given Inventories record by its ID. This includes the notes and spare fields.

Permissions​

This method requires the INVENTORY.WRITE.SAVE permission.

Syntax​

system.mes.inventory.setInventoryMetadata(inventoryId, notes, spare1, spare2, spare3, name, productionOrderIdOrName)

Parameters​

ParameterTypeNullableDescription
inventoryIdString (ULID)FalseThe ID of the inventory to update.
notesStringTrueNotes related to the location property value.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.
nameStringTrueThe name of the inventory.
productionOrderIdOrNameStringTrueThe ID or Name of the production order to associate with the inventory.

Returns​

Returns a JSON representation of an inventory.

Code Examples​

# Update the inventory metadata by inventory ID
updatedMetadata = system.mes.inventory.setInventoryMetadata('DDFBVX9Z-01JDTF12WX-8277CPVM', None, '1732833681021216', None, None, None, None)

# Output the updated inventory
print(updatedMetadata)