Last active
April 5, 2016 07:55
-
-
Save ryanjonhealy/7c3a16008eec07ef70e2777847b0d528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var featureCollection; | |
var oneFeature; | |
var site; | |
var guid | |
function findFeatureId() { | |
var clientContext = new SP.ClientContext(); | |
site = clientContext.get_web(); | |
clientContext.load(site); | |
featureCollection = site.get_features(); | |
clientContext.load(featureCollection); | |
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); | |
} | |
function onQuerySucceeded() { | |
var listEnumerator = featureCollection.getEnumerator(); | |
var featureInfo = ''; | |
while (listEnumerator.moveNext()) { | |
oneFeature = listEnumerator.get_current(); | |
featureInfo += 'Feature ID: ' + oneFeature.get_definitionId() + '\n'; | |
guid = oneFeature.get_definitionId(); | |
} | |
alert(featureInfo); | |
} | |
function onQueryFailed(sender, args) { | |
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment