User Object (Client and Server)
To assist in getting quick access to various details of a user record, we have two different versions of the User Object. One for server side, one for client side.
Server
To access the server side version of the user object, you can access it by doing the following.
//All lower case.user;//This can then be used such as. let userId = user.getID();
Method | Returns | Description |
|---|---|---|
getID() | String | This gets the ID of the currently logged in user record as a string. |
getUserName() | String | This gets the user name of the currently logged in user record as a string. |
getFirstName() | String | This gets the first name of the currently logged in user record as a string. |
getLastName() | String | This gets the last name of the currently logged in user record as a string. |
getEmail() | String | This gets the primary email of the currently logged in user record as a string. |
getTimeZone() | String | This gets the timezone of the currently logged in user record as a string. |
getCompanyID() | String | This gets the company ID of the currently logged in user record as a string. |
getRecord() | Table Object | This gets the whole Table record version of the currently logged in user record as a table object. |
getRoles() | Array of Strings | This gets the role names of the currently logged in user record as an array of strings. |
hasRole(roleName: String) | Boolean | This determines if the currently logged in user has a specific role and returns a boolean. |
getGroupIDs() | Array of Strings | This gets the group IDs of the currently logged in user record as an array of strings. |
Client
To access the client side version of the user object, you can access it by doing the following.
//Upper case first letter
User;
//This can then be used such as.
let userId = User.getID();Method | Returns | Description |
|---|---|---|
getID() | String | This gets the ID of the currently logged in user record as a string. |
getUserName() | String | This gets the user name of the currently logged in user record as a string. |
getFirstName() | String | This gets the first name of the currently logged in user record as a string. |
getLastName() | String | This gets the last name of the currently logged in user record as a string. |
getEmail() | String | This gets the primary email of the currently logged in user record as a string. |
getTimeZone() | String | This gets the timezone of the currently logged in user record as a string. |
getRoles() | String | This gets the role names of the currently logged in user record as an array of strings. |
hasRole(roleName: String) | Boolean | This determines if the currently logged in user has a specific role and returns a boolean. |