This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to get UserName in C# method

abhi - Tuesday, September 29, 2015 1:33 AM:

Hello

 

Is there anyway to get username ? All I can see is that we can get user id using the method - getUserID().



tstickel - Tuesday, September 29, 2015 10:02 AM:

Below is a C# code sample that retrieves the login name, first name and last name.

 

Innovator thisInnov = this.getInnovator();

string thisUserID = thisInnov.getUserID();

Item userItem = this.newItem("User","get");

userItem.setID(thisUserID);

userItem.setAttribute("select","first_name,last_name,login_name");

userItem = userItem.apply();

return thisInnov.newResult(userItem.getProperty("login_name") + " " +

userItem.getProperty("first_name") + " " +

userItem.getProperty("last_name"));



abhi - Tuesday, September 29, 2015 11:34 PM:

Works perfectly. Thanks a lot !