Created
January 30, 2015 11:52
-
-
Save wictorwilen/0497cc0ab8e3097e1b00 to your computer and use it in GitHub Desktop.
Remove a field programatically from a list 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 context = SP.ClientContext.get_current() | |
var web = context.get_web() | |
var lists = web.get_lists() | |
var list = lists.getByTitle('Test') // Replace with title of list | |
var cols = list.get_fields() | |
var col = cols.getByInternalNameOrTitle('XYZ') // replace with title or internal name of column | |
col.deleteObject() | |
context.executeQueryAsync( | |
function(){ | |
alert('Done') | |
}, | |
function() { | |
alert('Error') | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment