Skip to main content

system.mes.shift.getShiftsByLocation

Description

Retrieves Shifts records for the specified location.

Syntax

system.mes.shift.getShiftsByLocation(locationIdOrPath)
system.mes.shift.getShiftsByLocation(locationIdOrPath, includeDisabled)

Parameters

Method 1: With Location Only

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID or path to find shifts for.

Method 2: With Include Disabled Flag

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID or path to find shifts for.
includeDisabledBooleanTrueWhether to include disabled records. If null/omitted, defaults to false.

Returns

Returns a list of JSON objects representing the shifts found for the location.

Code Examples

# Retrieve shifts for a location (enabled only)
shifts = system.mes.shift.getShiftsByLocation('DairyCo/Plant1/Line1')
print(shifts)

# Retrieve shifts for a location including disabled
all_shifts = system.mes.shift.getShiftsByLocation('DairyCo/Plant1/Line1', True)
print(all_shifts)