Share via


USERID Function (Sessions)

Gets the user name of the user account that is logged on to the current session.

Syntax

  
ID := USERID  

Property Value/Return Value

Type: Text or Code

This string contains the value of the User Name field in table 2000000120, the User table, for the current user.

Example

This example requires that you create the following variables and text constant in the C/AL Globals window.

Variable name DataType
User Text
Text constant name ConstValue
Text000 The system was started by %1.
User := USERID;  
MESSAGE(Text000, User);  

The following is an example of the output of the previous code:

The system was started by cronus\simon.

See Also

USERSECURITYID Function
SID Function (Database)
Database