User Profile Information

rss

Posted by Jdubs - Apr 21 ’15 at 03:12

I'm not able to deduce how to get the User Profile information via the instructions in the following thread:  http://forum.spform.com/forms-designer-for-sharepoint-20/how-to-get-user-profile-from-active-directory-27308/

Is it possible to post the code for retrieving a user's Department and Manager?  (That's essentially what I need.)

 

I have the following code to get Current User:  can I re-use this code in any way and just replace some words to get Department and Manager?

 

// Load current user login

SP.SOD.executeOrDelayUntilScriptLoaded((function () {

var ctx = new SP.ClientContext.get_current();

var web = ctx.get_web();

ctx.load(web);

var user = web.get_currentUser();

user.retrieve();

ctx.executeQueryAsync(

function () {

// Set user login

fd.field('AssignedTo').control().value(user.get_loginName());

// Run validation by emulating validation image click

fd.field('AssignedTo').control()._el().find('a:eq(0)').click();

});

 

}), "SP.js");

Displaying 1 to 1 of 1 messages