I'm writing a polling app for Sharepoint 2013. I created a custom list and need to save the user's vote for each poll.
How do I pass in the Active Directory Name into a label control on the app?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI'm writing a polling app for Sharepoint 2013. I created a custom list and need to save the user's vote for each poll.
How do I pass in the Active Directory Name into a label control on the app?
Something like this.
this.currentContext = new SP.ClientContext.get_current();
this.currentUser = this.currentContext.get_web().get_currentUser();
this.currentContext.load(this.currentUser);
this.currentContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
onQuerySucceeded = function () {
var intCount = 1;
$(".ms-inputuserfield").html(this.currentUser.get_loginName());
};
The code isn't tested but you get the idea I think.