CSC515107. Prevent SharePoint field from deletion.

Description

If we don't want to let the users to delete the field in SharePoint provide template with attribute AllowDeletion="FALSE"

Resolution

Add attribute AllowDeletion="FALSE" to the field template.

How to delete SharePoint list column programmatically with PowerShell
#Get the Web
$web = Get-SPWeb "http://yoursite.com"
 
#Get the List
$list = $web.Lists["Design Documents"]
 
#Get the column
$column = $list.Fields["Category"]
 
#Disable Delete
$column.AllowDeletion = $true
$column.Sealed = $false
$column.Update()
 
#To delete a SharePoint list column in PowerShell, use: $column.Delete()
 
$web.Dispose()

Links

Field Element

Last edited Jan 17, 2014 at 10:35 AM by dvd73, version 3

Comments

No comments yet.