hr_Utils - Scoped
-
- UpdatedJan 30, 2025
- 1 minute read
- Yokohama
- API reference
The hr_Utils API provides basic functionality for the Human Resource (HR) application.
This API requires the HR core plugin (com.sn_hr_core) and runs in the sn_hr_core
namespace.
hr_Utils - hr_Utils()
Instantiates an instance of the hr_Utils class.
Name | Type | Description |
---|---|---|
None |
hr_Utils - getPrimaryJob(String userId)
Gets the Sys ID of the active primary job for a provided user.
Name | Type | Description |
---|---|---|
userID | String | Sys ID of the HR user from the User [sys_user] table assigned an active or future job in which Primary is true. |
Type | Description |
---|---|
String | If present and active, Sys ID of the primary job from the Jobs [sn_hr_core_job] table, null otherwise. |
Example
Output:
hr_Utils - switchPrimaryJob(String userId String jobId)
Switches the primary job of a user.
Name | Type | Description |
---|---|---|
userId | String | Sys ID of HR user from the Users [sys_user] table. |
jobId | String | Job Sys ID from the Jobs [sn_hr_core_job] table. |
Type | Description |
---|---|
String | Encoded JSON with message and status, error otherwise. |
Example
Output: