Skip to main content

system.mes.location.getLocationTree

Description

No Filter: Retrieves all Locations records as a tree structure.

With a Filter: Retrieves all Locations records whose names contain a substring that matches the filter. Returns the parent locations even if they don't contain the filter.

Syntax

system.mes.location.getLocationTree()
system.mes.location.getLocationTree(filter)

Parameters

No Filter:

ParameterTypeDescription
None-This method does not take any parameters.

With a Filter:

ParameterTypeDescription
nameStringThe name or substring of a name of the location to retrieve.

Returns

Returns a list of JSON objects. Each JSON object has the following properties:

NameTypeDescription
childrenList<JSON Object>The children of the location. The JSON objects in the list have the same properties as the parent.
nameStringThe name of the location.
descriptionStringA detailed description of the location.
parentIdStringThe ULID of the parent location.
typeStringThe type of the location (e.g., ENTERPRISE, COMPANY, SITE, AREA, LINE, CELL_GROUP, CELL, UNIT).
processTypeStringThe process type for the location (e.g., STORAGE, CONTINUOUS, BATCH, DISCRETE, NONE).
sortOrderIntegerDetermines the display order of the location.
allowNegativeInventoryBooleanAllows inventory to go negative at this location.
storageCapacityDoubleMaximum storage capacity allowed at the location.
storageCapacityUnitIdStringThe ULID for the storage capacity unit.
lotStorageStrategyStringDefines the lot storage strategy (e.g, ALLOW_MULTIPLE, ALLOW_SINGLE_OR_THROW, MERGE_INTO_PREVIOUS, MERGE_INTO_NEW, NO_STORAGE).
lotUseStrategyStringDefines the lot usage strategy, such as FIFO or FEFO.
pathStringPath of the location within the hierarchy.
idString (ULID)The ULID of the location.
notesStringNotes related to the location.
enabledBooleanIndicates if the location is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Retrieve all locations with the substring 'Plant' in their name and their parents
location_tree = system.mes.location.getLocationTree('Plant')

# Output the location tree
print(location_tree)