GUIDs in SharePoint Site Columns

As you know, SharePoint uses a lot of GUIDs. Usually it makes no difference if you include the accolades around the GUID, except when defining Site Columns. Of course, SharePoint doesn’t actually complain about the lack of accolades, not even when you reference your Site Column in a Content Type. It will just completely ignore the Site Column and not include it in the Content Type.

Wrong:



<ID="f35719f9-2c30-4a6b-9962-69b481139a02"
Name="FunctionCode"
DisplayName=""
Group="UserProfile Function History Columns"
Type="Text"
Required="false"
/>


Right:



<ID="{f35719f9-2c30-4a6b-9962-69b481139a02}"
Name="FunctionCode"
DisplayName=""
Group="UserProfile Function History Columns"
Type="Text"
Required="false"
/>


References to the Site Columns do not need to include the accolades. The following will still work:



<ID="f35719f9-2c30-4a6b-9962-69b481139a02"
Name="FunctionCode"
DisplayName=""
Required="false"
/>


This entry was posted in .NET and tagged , , . Bookmark the permalink.

2 Responses to GUIDs in SharePoint Site Columns

  1. Koen says:

    I think the Wrong en Right example are the same. Both use accolades.

  2. Mark says:

    Woops, indeed. Copy/paste error I guess. Still getting used to the WordPress content editor. 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

*