Skip to content

Instantly share code, notes, and snippets.

@TheKidVince
Created March 16, 2017 10:57
Show Gist options
  • Save TheKidVince/ef4556a010e82db02d8ba559b94324d0 to your computer and use it in GitHub Desktop.
Save TheKidVince/ef4556a010e82db02d8ba559b94324d0 to your computer and use it in GitHub Desktop.
Set AllowDeletion for SharePoint list or library using JSOM
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