Skip to main content

system.mes.shift.deleteAllShifts

Description

Deletes multiple Shifts by their IDs. This cannot delete a shift that has references to it from other system components.

Syntax

system.mes.shift.deleteAllShifts(ids)

Parameters

ParameterTypeNullableDescription
idsString[] (ULIDs)FalseA list of IDs of the shifts to delete.

Returns

If successful, an ApiResponse object is returned with the success flag set to true. If any of the shifts being deleted have references, an ApiResponse object is returned with details about the encountered error.

NameTypeDescription
successBooleanIndicates if the delete was successful.
messageStringThe reason why the deletion was successful or unsuccessful.
dataStringThe data associated with the deletion.
errorStringThe errors associated with the deletion.

Code Examples

# Delete multiple shifts by ID
result = system.mes.shift.deleteAllShifts([
'01JAP8RJBN-8ZTPXSGY-J9GSDPE1',
'01JAP8RJBN-8ZTPXSGY-J9GSDPE2'
])

if not result['success']:
print('Failed to delete shifts: ' + result['message'])