UserName (NotesSession - JavaScript)

Read-only. The full name of the user or server that created the session.

Defined in

NotesSession

Syntax

getUserName() : string

Usage

This is the name of the "user" running the script, which for a server-side script is the server name. For the name of the user logged into the server, use EffectiveUserName (NotesSession - JavaScript).

If the user name is hierarchical, this property returns the fully distinguished name. To get only the common name, use the CommonUserName property.

Examples

This computed field displays the common user name, server name, and distinguished user name for the current session.
return "You are logged in as " + session.getCommonUserName() +
" on server " + session.getServerName() +
". Your full name is " + session.getUserName() + "."