JEAZ The bump and grind of daily SysAdmin life


Long XML Attributes Relief

If you deal with XML attributes running off the page..


Visual Studio has a setting to automatically indent XML attributes!
Long strings automatically turn into the nice auto-indented code below

[xml wrap:true][/xml]

Just go to Options and look under Text Editor > XML > Formatting Section Attributes

This option is particularly helpful for SharePoint XML and XSLT code.
Tags in SharePoint often have 50+ attributes!

Filed under: SharePoint No Comments

Remove Workflow Status Columns

Working in SharePoint 2010, I used the Content and Structure Tool to copy list items from a list with workflows to one without

Unfortunately, the workflow status column was also created in the destination list.
Clearly, this wasn't a useful column and I didn't want it in my fields.

How do you remove a workflow status column?
It's pretty easy with some PowerShell

PS C:\> $web = Get-SPWeb
PS C:\> $list = $web.Lists["List Name"]
PS C:\> $field = $list.Fields["Workflow Status Column Name"]
PS C:\> $field.Hidden
PS C:\> $field.ReadOnlyField
PS C:\> $field.ReadOnlyField = $false
PS C:\> $field.Update()

Once the field is no longer a ReadOnlyField you can delete it like any other column
You can also throw in $field.Delete() at the end