@UserName (JavaScript)

Returns the distinguished name of the current user.

Defined in

@Functions (JavaScript)

Syntax

@UserName() : string

@UserName(index:int) : string

Parameter Description
index Not operative as of Version 2.6.
Return value Description
string Distinguished name of the current user.

Usage

In Notes®, index 0 refers to the primary name and index 1 refers to the alternate name. In XPages, the index specification does not matter. This @function always returns the primary user name.

See @Name (JavaScript) for a description of distinguished names.

Examples

This example returns the common name component of the current user name.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var nm = @Name("[CN]", @UserName());
if(@ClientType() == "Web")
	p("Logged in from web: " + nm);
else
	p("Not logged in from web" + nm);