depts.Get
Overview¶
Get the information of one department by specifying the department ID in Server Script.
Methods¶
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| deptId | long | Yes | Specify the department ID to get. |
Usage Examples¶
const dept = depts.Get(2);
if (dept) {
context.Log(dept.DeptCode + ', ' + dept.DeptName);
} else {
context.Log('The department does not exist.');
}
Return Value¶
Returns the "dept object". For the layout of the object, see "Developer's Guide: Server Script: dept". If no department exists with the specified ID, null is returned.
{
"TenantId": 1,
"DeptId": 2,
"DeptCode": "D001",
"DeptName": "New Department",
"Disabled": false,
"ClassHash": {
"ClassA": "test-class-column"
},
"ClassHash": {
"ClassA": "test-class-column"
},
"NumHash": {
"NumA": 100
},
"DateHash": {
"DateA": "2026-08-19"
},
"DescriptionHash": {
"DescriptionA": "Supplementary description"
},
"CheckHash": {
"CheckA": true
}
}
Cautions¶
This is a method used in "Server Script". It cannot be used in "Script".
Supported Versions¶
| Supported versions | Body |
|---|---|
| 1.5.8.0 and later | Added the ability to get the values of extended columns |