@V3UserName (Formula Language)

Returns the current user name or server name. Using @V3UserName on a local database or in a private view in a server-based database returns the user's name.

If the user name is hierarchical, @V3UserName returns the name in abbreviated format (omitting the CN, OU, O, and C identifiers). To return the name in canonical format, use @UserName.

Note: If you used @UserName in Release 3 of Notes®, it is automatically converted to @V3UserName in Release 4 and later to preserve the functionality of your formulas. If you change those formulas to use @UserName, be sure to recompile them. If you use @UserName in Release 4 or later, a database created in Release 3 does not recognize the formula until you upgrade that database. If the formula will be evaluated in Release 3, use @V3UserName.

Syntax

@V3UserName

Return value

name

Text. The current user name or server name.

Usage

When a formula runs on a server, the server is considered the current user, so @V3UserName returns the name of the server. We do not recommend using @V3UserName in a public view. Doing so produces unpredictable results.

One use for @V3UserName is to display only those documents relevant to the current user. For example, your Service Request database could use @V3UserName in the private view named Assignments to display each technician's assignments, weeding out everyone else's:

SELECT @V3UserName=AssignedTo

However, the user can still design a different private view that retrieves all documents, so don't depend on @V3UserName as a security mechanism.

Examples

  1. @V3UserName returns Robert T. Smith if this is the name associated with the current user ID and returns Robert T. Smith/LA/Deli if this is the hierarchical name associated with the user ID.
  2. @Right(@V3UserName;" ") returns Fletcher if William Fletcher is the name associated with the current user ID.

    If the user ID is hierarchical, the following code returns Fletcher:

    @Right(@Name([CN]; @V3UserName); " ")
  3. @UpperCase(@Right(@V3UserName;" ")) returns FLETCHER if William Fletcher is the name associated with the current user ID.

    If the user ID is hierarchical, the following code returns FLETCHER:

    @UpperCase(@Right(@Name([CN]; @V3UserName); " "))
  4. Given this hierarchical user ID:
    CN=Mary Tsen/OU=Illustration/OU=Documentation/OU=Development/
    OU=R&D/O=WorkSavers/C=US

    @V3UserName returns the name in abbreviated format:

    Mary Tsen/Illustration/Documentation/Development/R&D/WorkSavers/US

    To return the name in canonical format (using the CN, OU, O, and C identifiers), use @UserName.