Created
March 16, 2017 10:57
-
-
Save TheKidVince/ef4556a010e82db02d8ba559b94324d0 to your computer and use it in GitHub Desktop.
Set AllowDeletion for SharePoint list or library using JSOM
This file contains hidden or 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 ctx = SP.ClientContext.get_current(); | |
// Change your list title here | |
var list = ctx.get_web().get_lists().getByTitle("Documents"); | |
list.set_allowDeletion(true); | |
list.update(); | |
ctx.executeQueryAsync( | |
function (o, d) { | |
console.log("You can now delete the list"); | |
}, | |
function (o, e) { | |
console.log(e.getmessage()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment