You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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


s_user.accessToken()




s_user.firstName()


Returns the first name of the current user.



Return:

TypeDescription
StringFirst name of the current user.


s_user.firstName


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.
s_user.getFullName()
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
StringFirst name of the current user.


s_user.lastName


s_user.userID()


Returns the user ID of the current user.


Return:

TypeDescription
Stringsys_id value for the current user.


s_user.userID

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 ot last name or full name (for example, John Doe).


TypeDescription
StringID of the current user.
s_user.userName

  • No labels