Friday, July 15, 2011

Tips & Tricks: IDs of standard out-of-the-box SharePoint fields

Another useful - How To find out the IDs of standard out-of-the-box SharePoint fields (like Title, Created By, Modified, File Size etc):
The best way is to look at the source - the same location where actually SharePoint is reading them. I am always looking at this file when I have to use out of the box fields in my custom content types.

Here is the location of the XML file that describes all fields with their GUIDs, internal names and, type and so on. The file can be found in 14 hive, in the Template -> Features floder, and the name of the feature is "fields". Inside this folder you can find fieldswss.xml that contais all the information we need:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\fields\fieldswss.xml

Here is an example of the fields description:

<!-- End Shared Among Base\List with Same Internal Name -->

<!-- Shared Among Base\List with Same Internal Name -->

    <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
         Name="Title"

         SourceID="http://schemas.microsoft.com/sharepoint/v3"
         StaticName="Title"
         Group="_Hidden"
         Type="Text"
         DisplayName="$Resources:core,Title;"
         Required="TRUE"
         FromBaseType="TRUE">
    </Field>

    <Field ID="{f1e020bc-ba26-443f-bf2f-b68715017bbc}"
        Name="WorkflowVersion"

        SourceID="http://schemas.microsoft.com/sharepoint/v3"
        StaticName="WorkflowVersion"
        Group="_Hidden"
        ColName="tp_WorkflowVersion"
        RowOrdinal="0"
        Hidden="TRUE"
        ReadOnly="TRUE"
        Type="Integer"
        DisplayName="$Resources:core,WorkflowVersion;" />

1 comment:

Shaune said...

You can also use the Microsoft.SharePoint.SPBuiltInFieldId class to get the Guids.