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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
ids | String[] (ULIDs) | False | A 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.
| Name | Type | Description |
|---|---|---|
success | Boolean | Indicates if the delete was successful. |
message | String | The reason why the deletion was successful or unsuccessful. |
data | String | The data associated with the deletion. |
error | String | The 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'])