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 - Info from User Item

vikramjain23 - Thursday, November 18, 2010 12:32 PM:

Hello,

I am unable to get user  info like Last name, first name, login name from user item.

username = user.GetProperty("last_name")

It always return null string.

Any clues,

Vikram



Brian - Friday, November 19, 2010 10:55 PM:

Hi Vikram,

if the code you have above is a copy/paste then the syntax is wrong. user.GetProperty should be user.getProperty.

var usr = this.newItem("User", "get");

usr.setProperty("first_name", "Innovator");

usr = usr.apply();

var lName = usr.getProperty("last_name");

 

after this javascript code runs lName = "Admin"

Have you tested that you have a valid "user" with data in it after you do an "apply" on the server?

Hope this helps.

Brian.