[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.

Robin

Software Engineer / Application Developer

Subscribe to robsCode

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!