Defining a custom list + custom content type = shows only one form field?

Attempted to use features to expand custom fields, type and content list. So far, I have a content type that references custom and inline fields. The content type inherits the element (0x01).

Now I create my own list definition that refers to the type and fields of the content (built-in and custom). I explicitly set the values ​​of ShowInDisplayForm, ShowInEditForm, ShowInNewForm to true, however, when I expand the function and create a list based on the definition, all I get is only one Title field in all forms!

However, if I add a field from the UI to the list, it will appear on the form! Also, if I create a user list from the user interface and add a content type, these fields are displayed on the forms!

What's up with that?

By the way, I use the VSeWSS tool for Visual Studio, so it already encodes a lot of things.

Some codes:

 <ContentTypes> <ContentTypeRef ID="0x01003420C661289843dbAB9E41F43C23BFD0" /> </ContentTypes> <Fields> <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Group="$Resources:core,Extended_Columns" Required="TRUE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" Type="Text" Sortable="TRUE" Filterable="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> <Field ID="{B4629012-C672-4911-B0D0-B9CB2DA44ED2}" DisplayName="Jautājumu pacēla" Group="$Resources:core,Extended_Columns" Name="QuestionRisedBy" Required="TRUE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" Type="User" Sortable="TRUE" Filterable="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> <Field ID="{6DF9BD52-550E-4a30-BC31-A4366832A87F}" DisplayName="Komentārs" Group="$Resources:core,Extended_Columns" Name="Comment" AppendOnly="TRUE" Required="FALSE" NumLines="12" Type="Note" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" Sortable="FALSE" Filterable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> <Field ID="{FC072586-E8BB-444f-AAA4-8D5745FBC096}" DisplayName="ParentItemId" Group="$Resources:core,Extended_Columns" Name="AgendaParentItemId" Required="TRUE" Type="Integer" Sortable="FALSE" Filterable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> <Field ID="{29207E42-E107-4379-B620-BAAFC461276B}" DisplayName="AgendaRootItemId" Group="$Resources:core,Extended_Columns" Name="AgendaRootItemId" Required="TRUE" Type="Integer" Sortable="FALSE" Filterable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> <Field ID="{06063FDB-3C2A-4141-91F7-28C2739CE6B5}" DisplayName="AgendaItemClosed" Group="$Resources:core,Extended_Columns" Name="AgendaItemClosed" Required="FALSE" Type="Boolean" Sortable="TRUE" Filterable="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" /> </Fields> 
+4
source share
1 answer

Yes, ContentType has a FieldRef for all fields (well, not inherited). However, I read that when defining types of contexts in schema.xml you must explicitly define Field` as well (this is strange), however if you add ContentType programmatically, then it correctly adds CType fields to the definition .

By the way, you see that VSeWSS (Microsoft extension for VS) is generated (all links).

Absolutely from the SharePoint blog :

What you need to do is add the exact elements as in the content type, including the same identifier. This is a little strange, but in fact you need to define the fields twice, both in the content type and in schema.xml to make this work. You can skip Group and several other properties.

However, if I do not use the fields, I will get an exception:

 [COMException (0x80004005): Nevar pabeigt šo darbību. Lūdzu, mēģiniet vēlreiz.] Microsoft.SharePoint.Library.SPRequestInternalClass.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex) +0 Microsoft.SharePoint.Library.SPRequest.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex) +122 

Oh, well, in any case, I read an article (I can’t find this article no more), proposing to add a content type with function receivers, after which it correctly displays fields in forms.

+4
source

All Articles