Fields not Showing in Custom List Definition
Published October 8th, 2008 in SharePointFor an internal project we were creating a number of custom List Definitions by editing the schema.xml files. When we opened an instance of the List Definition in SharePoint, the fields we had added did not show up in the View, New and Edit forms. Only the Title field was visible.
As it turned out, the schema.xml file contained the following xml:
<List xmlns:ows="Microsoft SharePoint" ... > <MetaData> <ContentTypes> <ContentTypeRef ID="0x01"> <Folder TargetName="Item" /> </ContentTypeRef> <ContentTypeRef ID="0x0120" /> </ContentTypes> ...
According to Microsoft, the ContentTypeRef element “specifies a reference to a content type to associate with lists that are created through the list definition”. In this case the Content Types are Item and Folder. For a list of the default Content Types included in Windows SharePoint Services 3.0, and their content type IDs, see here. For some more information on Content Types, see the Introduction to Content Types in the MSDN Library.
Obviously (in retrospect) the Item and Folder Content Types do not contain our custom Fields, only the Title Field. Removing the ContentTypes element altogether solved the problem and made all Fields visible in the View, New and Edit forms.
Hope this helps.

0 Responses to “Fields not Showing in Custom List Definition”
Please Wait
Leave a Reply