$p.apiDeptsDelete
Overview¶
Deletes a department via an Ajax POST request.
Syntax¶
$p.apiDeptsDelete({
id: <ID of the department to delete>,
done: <Optional Processing>,
fail: <Optional Processing>,
always: <Optional Processing>
});
Parameters¶
| Parameter name | Type | Required | Description |
|---|---|---|---|
| id | long | Yes | ID of the department to delete |
| done | function | Yes | Processing when API communication succeeds |
| fail | function | Processing when API communication fails | |
| always | function | Processing when API communication completes |
Usage Examples¶
$p.apiDeptsDelete({
id: 2,
done: function (data) {
console.log(data);
console.log('The department information was deleted successfully.');
},
fail: function (data) {
console.log('Failed to delete department information.');
},
always: function (data) {
console.log('Deletion of department information has completed.');
}
});
Return Value¶
On normal completion, an object like the following is returned.
{
"Id": 2,
"StatusCode": 200,
"Message": "\" [Name of the deleted department] \" has been deleted."
}
Items of the Return Value¶
| Item | Description |
|---|---|
| Id | ID of the deleted department |
| StatusCode | Status code of the execution result |
| Message | Execution result message |
Notes¶
- If a department with the specified ID does not exist, a 404 (Not Found) error is returned.
- If the department cannot be deleted (for example, because of a reference constraint), a 403 (Forbidden) error is returned.
Supported Versions¶
| Supported versions | Description |
|---|---|
| 1.5.8.0 or later | Function added |
Related Information¶
$p.apiDeptsGet
Developer's Guide: Script: $p.apiDeptsCreate
Developer's Guide: Script: $p.apiDeptsUpdate