Get Sharepoint List Base Template ID using javascript.
var siteUrl = '/ClientGNH/New%20ProjectTemplate';
var title = ""; // List name
function retrieveSpecificListProperties() {
var clientContext = new SP.ClientContext(siteUrl);
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists().getByTitle(title);
clientContext.load(collList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
var listInfo = ''+collList.get_title() +'\n'+ collList.get_baseTemplate();
alert(listInfo);
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
retrieveSpecificListProperties();
No comments:
Post a Comment