/ Dynamics

[X++] Short code: name of current user

The old fashioned way to get the name of the current user is to select the record from UserInfo:

UserInfo    userInfo;
    
    select firstOnly name from userInfo
        where userInfo.id == curUserId();

Instead of selecting the table UserInfo, the application has a neat class for such information:

xUserInfo::find().name;

The find method returns a record of type UserInfo and then you can access its fields easily.

[X++] Short code: name of current user
Share this

Subscribe to robsCode