SharePoint: how deploy lists or document libraries with a predefined folder structure via CAML

In SharePoint, it's possible to deploy lists and libraries with a predefined folder structure via CAML.

Simply, in the ListInstance tag, add Row tags (inside a global Rows parent tag), as shown in Provision a folder inside a document library.

It's also possible to create nested folders using the FileDirRef tag.

For example, the xml below creates one folder (FolderA) with a nested folder (FolderBinA) with a nested folder (FolderCinB).

<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="">

<ListInstance FeatureId="{00bfea71-e717-4e80-aa17-d0c71b360101}" TemplateType="101" Title="DamianoDocLib" Description="" Url="DamianoDocLib" CustomSchema="Files\DamianoDocLib\Schema.xml" HyperlinkBaseUrl="http://test_sp" RootWebOnly="FALSE" xmlns="">




<Field Name="ID">1</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderA</Field>

<Field Name="MetaInfo">1;#</Field>

<Field Name="Order">100.000000000000</Field>

<Field Name="Title">FolderA</Field>



<Field Name="ID">2</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FileDirRef">FolderA</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderBinA</Field>

<Field Name="MetaInfo">2;#</Field>

<Field Name="Order">200.000000000000</Field>

<Field Name="Title">FolderBinA</Field>



<Field Name="ID">3</Field>

<Field Name="ContentTypeId">0x0120003CCC413DD038BE4CAB81E6C6F4C08742</Field>

<Field Name="_ModerationStatus">0</Field>

<Field Name="FileDirRef">FolderA/FolderBinA</Field>

<Field Name="FSObjType">1</Field>

<Field Name="FileLeafRef">FolderCinB</Field>

<Field Name="MetaInfo">3;#</Field>

<Field Name="Order">300.000000000000</Field>

<Field Name="Title">FolderCinB</Field>






SharePoint 2013: Developer Dashboard

SharePoint 2013 improved the Developer Dashboard introduced in SharePoint 2010.

A few notes:
  • it's available only On Premises and not in Office 365;
  • it's enabled/disabled for all users in the farm.

The blog post Developer Dashboard in SharePoint 2013 described how to enable it:
  • create the Usage and Health Data Collection Service Application:
         New-SPUsageApplication -Name "Health and Usage Application" -DatabaseName "SP2013_Health_and_Logging_Database"
  • enable the Developer Dashboard:
         $snapin = Get-PSSnapin | Where-Object { $_.Name -eq "Microsoft.SharePoint.PowerShell" }
         if ($snapin -eq $null) {
              Write-Host "Loading SharePoint PowerShell Snapin..." -ForegroundColor Gray
              Add-PSSnapin "Microsoft.SharePoint.PowerShell"
         Write-Host "Microsoft SharePoint PowerShell Snapin loaded" -ForegroundColor Gray

         $svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
         $dds = $svc.DeveloperDashboardSettings
         $dds.DisplayLevel = "On"

You can filter who is able to see and use the Developer Dashboard with the RequiredPermissions property.

On my developer machine, after enabling the Developer Machine, it takes a little while before it start logging.

SharePoint 2013: setup of a development machine

You can setup SharePoint 2013 following the pretty good guide Setting up a Single-box SharePoint 2013 Virtual Machine (in alternative to the raw TechNet guide How to: Set up an on-premises development environment for apps for SharePoint).

For the creation of the proper accounts (for both SQL Server and SharePoint), you can follow the articles below:
After that, for App development you need to follow:

SharePoint: wrong password cached

This morning I was not able to access my usual SharePoint site.
It said my password is wrong, but I was able to access other SharePoint sites from the same farm.

I have found the article SharePoint caches incorrect credentials, that suggests to delete the saved credential in the client from computer from "Manage your network passwords" in Control Panel.

In short, you can find them in Control Panel, User Accounts, then Manage your network passwords.

Nintex workflow: Commit Pending Actions

In one Nintex workflow I have developed, I had a strange bug. In short:
  • the workflow updated the current item
  • and then removed the write rights to the item
Well, what is strange is that I had workflow errors, and logging in the history list, I could clearly see that some operations where logged before others, really difficult to understand...

In this article it is explained that some actions are batched, in particular when is a mix of SharePoint and Nintex workflow actions.

The solution is: use the Commit Pending Action.