Skip to content

Instantly share code, notes, and snippets.

@TheKidVince
TheKidVince / SetAllowDeletion.js
Created March 16, 2017 10:57
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) {
// By Vincent Rothwell
// http://blog.thekid.me.uk
//
// Taken from blog post http://bit.ly/Create-XLSX-JavaScript-SharePoint
function createSpreadsheetData(number) {
var openedSpreadsheet = new openXml.OpenXmlPackage(blankSpreadsheet);
var workbookPart = openedSpreadsheet.workbookPart();
var wbXDoc = workbookPart.getXDocument();