Skip to main content

system.mes.personnel.deleteDepartment

Description

Deletes a Personnel Department record by its ID or path. This cannot delete a department with references to it.

Syntax

system.mes.personnel.deleteDepartment(idOrPath)

Parameters

ParameterTypeNullableDescription
idOrPathStringFalseThe ID or path of the department 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 a department by ID or path
system.mes.personnel.deleteDepartment('01JAP8R5RT-3FPXQABY-7KQZT6VF')