Showing posts with label user profile. Show all posts
Showing posts with label user profile. Show all posts

Saturday, 2 November 2013

Internal Names of SharePoint User Profile Fields

SharePoint user profile contains information about the user such as name, title, phone number, email address, etc. It has two types, namely WSS Profile and MOSS Profile. WSS Profile can be accessed from Welcome User >> My Settings page (_layouts/userdisp.aspx?.......) while MOSS Profile can be accessed from My Site (../Person.aspx?....) and it is created when users are imported into the system from AD or LDAP.

Basically, there are two MOSS Timer jobs that control the replication of the user profiles per web application. These are Profile Synchronization and Quick Profile Synchronization. The difference between the two is Profile Synchronization updates the WSS profile whereas Quick Profile Synchronization updates the MOSS profiles. Both of these jobs can be found in Central Administration -> Operations -> Timer Job definitions. 

If you want to access the user profile columns / fields in code, you need to know its equivalent internal names. Actually, the internal names of the columns are different depending on the types of user profile.

So for your reference, I have listed below the user profile fields and its corresponding internal names.


WSS Profile (User Information List) MOSS Profile (SSP User Profile)
Display Name Internal Name Display Name Internal Name
Account Name Account name AccountName
First name FirstName First name FirstName
Last name LastName Last name LastName
Name Title Name PreferredName
Work phone WorkPhone Work phone WorkPhone
Office Office Office Office
Department Department Department Department
Title JobTitle Title Title
Work e-mail EMail Work e-mail WorkEmail
User name UserName



Saturday, 5 October 2013

Get User Profile Picture URL Using JQuery

I encountered an issue while working on a discussion board in SharePoint 2007. The issue is the user's profile picture is not displaying in the flat view of the discussion board even though there is a picture associated with the user profile. Instead the picture from this url "_layouts/images/person.gif" is displaying. So in order to fix this issue, I just used jQuery.

Here is the sample script on how to get the user profile picture url through jQuery:

function spjs_QueryPicURL(itm){
var pic=null;

var query = "<Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>"+itm+"</Value></Eq></Where></Query>";
$().SPServices({
    operation: "GetListItems",  
    async: false,
    listName: "6ccdab10-1068-4d14-8f72-2a55f02938da",
CAMLQuery: query,
    CAMLViewFields: "<ViewFields><FieldRef Name='Picture' /></ViewFields>",  
    completefunc: function (xData, Status) {    
      $(xData.responseXML).find("[nodeName='z:row']").each(function() {
        pic = $(this).attr("ows_Picture");
      });
    }
  });
 
if(pic == 'undefined')
pic=null;

return pic;
}


**** Note:

listName is the list ID of User Information List

****************