Fields type "User"

Nov 9, 2009 at 5:39 AM

I am trying to understand user lookup fields. I have two questions.

  1. Are all of the attributes from a person lookup stored in either the Lists or the Forms JSON? If so, can you provide a quick jQuery to pull it? I am able to pull the display value from the Form with jP.Form.{fieldname}.val(), but not the other potential fields.
  2. In the samples on the http://www.sharejpoint.com website there is an example where it places JASON lookup data in that field. (I have yet to be able to reproduce that.) Is the only way that I can get the full set of attributes to do the luser ookup webservice call?

Bill

Sorry if this is a bit off-topic for jPoint. You guys understand sharepoint data structures better than most...

Coordinator
Nov 9, 2009 at 6:15 AM

See example http://www.sharejpoint.com/examples/Lists/jPInspector/NewForm.aspx

Click TryIt under "Assigned To" field.  The get and set val should work for the user lookup field.  Only the user id text is available through the client form.  To get other attributes, you will have to query using webservices.

Download jPoint version 0.7 available tomorrow so you have the latest.

 

Coordinator
Nov 9, 2009 at 6:23 AM

For webservices see examples here http://www.sharejpoint.com/examples/src/jPWebServices.aspx

Webservice UserGroup with operation GetUserInfo will give some more info on user. 

Nov 9, 2009 at 6:34 AM

Ken, I am reading the MSDN info on the webservices now. I played with the example but was unable to make the equivalent work in my code.

I was hoping to pull the "created by" field in order to preset some of my form fields based on their department, etc. I haven't found a path of execution yet, but am still looking.

Coordinator
Nov 13, 2009 at 3:45 AM

Bill, check-out the new jPoint.userprofile plugin.  This will do what you need. 

http://jpoint.codeplex.com/Thread/View.aspx?ThreadId=74966