Friday 16 July 2010

All about SPField - Internal Name, Display Name, & GUID

First of all, Thank goes to Ken for the investigation.

Few words on the web about internal, static and display names of columns. There aren’t any simple Microsoft statement on the subject


Create Site Column through GUI:

-- DisplayName must be unique. SharePoint will adjust StaticName & InternalName to keep them unique.

Create Site Column through Feature and XML:

-- xml-Name (InternalName) must be unique. SharePoint will allow duplicate DisplayName & StaticName.
*** Duplicate Internal names will not create a field (If you already have a site field with the same Internal Name). “No error will be raised”.

Create List Column through GUI:

-- DisplayName must be unique. SharePoint will adjust StaticName & InternalName to keep them unique.

Adding site columns to list columns via GUI:

-- DisplayName and StaticName don't have to be unique. SharePoint will make InternalName unique.


Source: http://www.sharepointlessonslearned.com/blogs/blog1.php/2010/03/04/field-name-uniqueness-rules-vary-between-gui-and-api


In addition to that:

** Content types that refer to the missing field will have orphaned local field, and the list will continue to function.

** Fields created from code (Fields.AddFieldAsXml) - These will raise an error if internal name exists.

** Fields created from code (Fields.Add) - Sharepoint makes unique name.

No comments:

Post a Comment