Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function getListAuthor(listTitle,OnSuccess,OnError) {
getListProperties(listTitle,
function(listJson){
var context = SP.ClientContext.get_current();
var listAuthor = context.get_web().getUserById(listJson.Author);
context.load(listAuthor);
context.executeQueryAsync(
function(){
OnSuccess(listAuthor);
},OnError);
},
OnError);
}
//Usage
getListAuthor('Discussion Board',
function(author){
console.log('List created by: ' + author.get_loginName());
},
function(sender,args){
console.log('Error occured:' + args.get_message());
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.