The Devil’s in the Details….

On a recent large scale SharePoint workflow deployment, a colleague and I discussed how many minor details go into building SharePoint composite solutions. We were continually amazed at the time spent on minor items; field choices, views, forms, etc. I need hours to consolidate the things we learned – but here’s a little pearl – when creating SharePoint list fields, do this every time:

* Create your field and concatenate the field – “TrackingDueDate”
fieldtitle

* After you save the field – go back and humanize it “Tracking Due Date”
fieldtitlehuman

* Now note the URL of the field settings page:
url

This may seem like a no brainer – but trust me – when you amass hundreds and thousands of list column fields – you will thank me you did it early on in your project. When it comes to code view, logs, trouble shooting, avoiding problems, forms, views, etc. this is a mark of quality and thoughtfullness in design.

Advertisements
Posted in Uncategorized | Leave a comment

SharePoint 2010 Powershell Copy List Item Attachments into Document Library Folders!

Check this out – you have a giant SharePoint list, packed full of attachments. This script will create a document library folder for each list item, then copy the attachments from the list item into the designated document library folder. After you run the script, you can disable attachments in the list settings, or run another Powershell to delete the attachments. I love Powershell!

$web=Get-SPWeb "http://sharepoint/sites/abc"
$list=$web.Lists.TryGetList("Item Documents")
$trackinglist = $web.lists["Tracking List"]
$items = $trackinglist.items
foreach($item in $items)
{
$title = $item.title
$folderItem = $list.AddItem("",[Microsoft.SharePoint.SPFileSystemObjectType]::Folder,"$title")
$folderItem["Title"] = "$title"
$folderItem.Update()
$attachments = $item.Attachments
$attachments.count
$progress ++
$progress

if($attachments.count -gt 0)
{
foreach($leafName in $attachments)
{
$leafName
$spFile = $$trackinglist.ParentWeb.GetFile($item.Attachments.UrlPrefix + $leafName)
$targetFile = $folderItem.Folder.Url + "/" + $spFile.Name
$dList = [Microsoft.Sharepoint.SPFolder]$web.GetFolder($folderItem.Folder.Url)
$dLibrary = $web.Lists[$dList.ContainingDocumentLibrary]
$sbytes = $spFile.OpenBinary()
$dFileName = $dList.Files.Add($targetFile, $sbytes, $true)
}
}

$docUrl = "/sites/abc/" + $folderItem.Folder.Url + "/, $title"
$item["Item Documents"] = $docUrl
$item.Update()
}
$web.dispose()

Posted in Uncategorized | Leave a comment

Powershell SharePoint 2010 Clean up SharePoint List Item Versions, BUT keep appended multi-line text entries!

This little gem is for cleaning up stupid versions of list items but keeps versions that contain entries made in appended multi-line text fields:


$web = get-spweb "http://sharepoint/sites/teamabc"
$list = $web.lists["Tracking List"]
$items = $list.items
foreach($item in $items)
{
write-host "-------------------------------------------"$item["Title"]
$versions = $item.versions
for($i=$versions.count-1; $i -ge 0; $i--)
{
if($versions[$i].IsCurrentVersion -eq $false)
{
$itemversion = $versions[$i]
if($itemversion["Tracking Comments"] -or $itemversion["Resolution Comments"])
{
write-host "Not Deleting: " $versions[$i]["Tracking Comments"] "------" $versions[$i]["Resolution Comments"] $i
}
else
{
$count++
write-host "Deleting: " $versions[$i].VersionLabel "------------" $item["Title"] "------------" $count "------------" $i
$item.versions[$i].Delete()
}
}
}
}
$web.dispose()

Posted in Uncategorized | Leave a comment

Ok, Ok, One more tool

DO NOT IMPLEMENT SHAREPOINT WITHOUT NINTEX WORKFLOWS

Posted in Uncategorized | Leave a comment

Best tool in my toolbelt

DO NOT IMPLEMENT SHAREPOINT WITHOUT Data Synchronisation Studio from Simego:

http://www.simego.com/Products/Data-Synchronisation-Studio

This tool has saved massive amounts of pain as it relates to content and data intregration with other systems. Having worked without it in other environments, I am continually impressed with how much time and money I save with it.

Posted in Uncategorized | Leave a comment