Skip to main content

system.mes.personnel.deleteDepartments

Description

Deletes multiple Personnel Department records by their IDs or paths. This cannot delete any departments that have references to them.

Syntax

system.mes.personnel.deleteDepartments(idsOrPaths)

Parameters

ParameterTypeNullableDescription
idsOrPathsList<String>FalseList of IDs or paths of the departments to delete.

Returns

If successful, an ApiResponse object is returned with the success bool set to true. If unsuccessful, an exception is thrown or 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 departments by IDs or paths
system.mes.personnel.deleteDepartments(['01JAP8R5RT-3FPXQABY-7KQZT6VF', '01JAP8RJBN-8ZTPXSGY-J9GSDPE1'])