Skip to main content

system.mes.inventory.setInventoryMetadata

Description

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

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
updated_metadata = system.mes.inventory.setInventoryMetadata('DDFBVX9Z-01JDTF12WX-8277CPVM', None, '1732833681021216', None, None, None, None)

# Output the updated inventory
print(updated_metadata)