Share via


USERID Function (Sessions)

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

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 client 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

Concepts

Database