Today I came across a really annoying bug inside SharePoint. Imagine you create a simple task list and you enable the management of content types. If you get into deeper analysis of the fields inside that list you will notice that the name of the “Status” field differs from the one used inside the content-type “Task”.
Flow of actions
Here is what I did…
This is definitely a bug. These StaticName properties of the fields should be the same! What is even more weird is the fact that the Id’s of the fields are identical! Both have a guid of “c15b34c3-ce7d-490a-b133-3f4de8801b76”!
If you look inside the schema.xml of the default task list (found in
12/Template/Features/TaskList/Tasks/schema.xml) you see that the StaticName is set to “Status”. If you take a look inside the ContentType-definitions of the sharepoint-core (found in
12/Templates/Features/ctypes/ctypeswss.xml) you will notice that the name of the field with the id “c15b34c3-ce7d-490a-b133-3f4de8801b76” is set to “Status”, too.
So I cannot explain why the fields in the ContentType “Task” are prefixed with “Task”. The field DueDate is also affected. Inside lists its StaticName is “DueDate” inside the ContentType its named “TaskDueDate”.
It seems that you can’t even rely on the StaticName! Instead always make use of the Id of a field!