Show/Hide Toolbars

In TeamConnect, a user exists independently of its user account record, meaning that if you need to get or set any information for a user, you must use the user account. All TeamConnect users have their own user accounts (instances of UserAccount) that include information such as username, password, and account status. Each user account is also linked to a contact record (instance of Contact) through the getContact() method. Use the UserService class to access with users in the API.

The API provides the following model interfaces for users:

The User class, which contains some read-only fields for the user. You can use this object to specify a user.

The UserAccount class, which contains all the fields for the user account in TeamConnect. You can use this object to get or set information for a user.

The UserType class, which contains the enums that indicate the type of user.

Because every username is unique, the username connects a user to its user account. When you create a new user, TeamConnect generates a key that you can also use to identify the user. Use the entity.getPrimaryKey method if you want to identify the user with its key.

Because you can change the user who is running the code, it is sometimes necessary to identify the current user. You can get the current user using the UtilityService.getCurrentUser() method.

Refer to the UserService samples for examples of working with users in the API.