Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This class provides access to the information about the current user and his prerequisites. The SimpleUser API class usage is getting rid of using slower SimpleRecord queries for user information retrieving,

s_user.accessToken


Returns access token of the current user.


Return:

TypeDescription
StringAccess token of the current user.


Code Block
languagejs
themeEclipse
titles_user.accessToken
linenumberstrue


s_user.firstName


Returns the first name of the current user.


Return:

TypeDescription
StringFirst name of the current user.


Code Block
languagejs
themeEclipse
titles_user.firstName
linenumberstrue


s_user.getFullName()


Returns the first and last name of the current user (see the values of the fields "First name" and "Last Name").


Return:

TypeDescription
StringFirst and last name of the current user.


Code Block
languagejs
titles_user.getFullName()
linenumberstrue
const commentValue = `${s_user.getFullName()}: "${s_form.getValue('comment')}"`;
s_form.setValue('additional_comment', commentValue);

s_user.lastName


Returns the first name of the current user.


Return:

TypeDescription
StringLast name of the current user.


Code Block
languagejs
themeEclipse
titles_user.lastName
linenumberstrue


s_user.userID


Returns the user ID of the current user.


Return:

TypeDescription
StringThe sys_id value for the current user.


Code Block
languagejs
themeEclipse
titles_user.userID
linenumberstrue

s_user.user


Returns a SimpleRecord object containing user data, such as first name, last name, sys_id value, and so on, formatted as JSON.


TypeDescription
SimpleRecord objectObject containing user information


Code Block
languagejs
themeEclipse
titles_user.user

s_user.userName


Returns the current user's username (for example, helpdesk.agent). Take a note that it does not return user's name, whether it be first name, or last name. or full name (for example, John, or Doe, or John Doe).


TypeDescription
StringID of the current user.


Code Block
languagejs
themeEclipse
titles_user.userName
linenumberstrue


Table of Contents
absoluteUrltrue
classfixedPosition