User Profile Information
Posted: 21 Apr 2015
I'm not able to deduce how to get the User Profile information via the instructions in the following thread: viewtopic.php?f=1&t=434
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");
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");