I had a silly error today when making a new list definition.
I created a schema.xml file and edited it as normal, but for the life of me, everything but the renamed “title” would not show on newForm.aspx.
Normally I make a Content type and use those fields in the schema.xml file, but this time I wanted to add the list fields without making a Content Type. The list I was making will only ever be created 1 time on the entire site, and its definition will be hidden so the users can’t create another.
<?xml version="1.0" encoding="utf-8"?><List xmlns="http://schemas.microsoft.com/sharepoint/"Title="MyList"FolderCreation="FALSE"Direction="$Resources:Direction;"Url="Lists/MyList"BaseType="0"DisableAttachments="true"VersioningEnabled="False"EnableContentTypes="False"><MetaData><ContentTypes></ContentTypeRef>--><ContentTypeRef ID="0x01"><Folder TargetName="Item" /></ContentTypeRef><ContentTypeRef ID="0x0120" /></ContentTypes><Fields><Field Name="LinkTitle"ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}"DisplayName="Description"Sealed="TRUE"SourceID="http://schemas.microsoft.com/sharepoint/v3"Type="Text" /><Field Name="LinkTitleNoMenu"ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}"DisplayName="Description"Sealed="TRUE"SourceID="http://schemas.microsoft.com/sharepoint/v3"Type="Text" /><Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"Name="Title"SourceID="http://schemas.microsoft.com/sharepoint/v3"DisplayName="Description"Type="Text"Sealed="TRUE" /><FieldType="Number"Decimals="0"Min="1"Max="31"Name="Day"DisplayName="Day"</Field><Field Type="Number"Decimals="0"Min="1"Max="12"Name="Month"DisplayName="Month"></Field><Field Type="Integer"Decimals="0"Commas="False"Min="1970"Max="2020"Name="Year"DisplayName="Year"></Field>...Abreaviated CAML
I did a bit of searching in google, and found out it was a silly mistake, and easily corrected.
The problem is I am adding the Content Type of “Item”,
<ContentTypeRef ID="0x01"><Folder TargetName="Item" ></Folder></ContentTypeRef>
But the Content type Item does not contain my fields… So to correct this error, all I had to do was remove the Content type reference.
Related posts:
- Add A Web Part To NewForm.aspx, EditForm.aspx And DispForm.aspx (Edit Page missing in menu)
- Hide Title field in a SharePoint List
- Quick intro to creating custom SharePoint (MOSS, WSS) site themes
- Your client does not support opening this list with Windows Explorer
- Programmatically reading value from Yes / No field (checkbox)
Your solution is stil Silly…….
This is not the right way , it does not work do no how is it working for you…
It might be silly, but at least it had a logical explanation.
Not adding the correct content type will create problems for sure.
I don’t know what your problem is, but it can still just be invalid CAML.