0

I develop a ListTemplate for a Site. The Schema.xml contains already my custom content type, fields and a view. So far it works, but the default Forms only display the title of the elements. I read various guides and walkthroughs but the behavior is always the same. Nothing happens. The used ContentType seems to be correct, because if I add the forms per SharePointDesigner the forms are working correctly (but this solution can't be used, because of project requirements). What did I do wrong?

Here comes the snippets from the Schema.xml:

<Fields>
      <FieldRef ID="30D9991A-34F3-455F-AE22-31929F68D797" Name="Attachments" 
                Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="TRUE" />
  <Field Name="Title" StaticName="Title" DisplayName="Titel" Type="Text" FromBaseType="TRUE"
         ID="21A9B1CC-CBEA-4D8A-9AEF-0F1BD7F1BE97"
         Required="TRUE" ShowInDisplayForm="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
  <Field Name="LastSendAt" StaticName="LastSendAt" DisplayName="Zuletzt versendet am" Type="DateTime"
         ID="EF7457B6-9B1E-4EC5-BDEA-25E7DC261F1E"
         Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="TRUE" />
  <Field Name="SendCount" StaticName="SendCount" DisplayName="Anzahl Gesendet" Type="Number"
         ID="5D2E3FFC-C4FA-40CB-8DBC-57C9BFF145A4" Min="0" Decimals="0"
         Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" >
    <Default>0</Default>
  </Field>
  <Field Name="ShowItem" StaticName="ShowItem" DisplayName="Anzeigen" Type="URL"
         ID="F67BF167-FD90-42E9-88F8-65BCBF107D21"
         Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
  <Field Name="SendAgain" StaticName="SendAgain" DisplayName="Erneut senden" Type="URL"
         ID="C90B89D2-613A-4075-A2F3-5C6359363589"
         Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
</Fields>
<ContentTypes>
  <ContentType ID="0x0100E2F56874BC38480481DA64E39727CAC0"
               Name="NewsletterContentType"
               Group="Custom Content Types"
               Description="Custom Content Type for Newsletter"
               Inherits="TRUE"
               Version="0" >
    <FieldRefs>
      <FieldRef ID="21A9B1CC-CBEA-4D8A-9AEF-0F1BD7F1BE97" Name="Title"  
                Required="TRUE" ShowInDisplayForm="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
      <FieldRef ID="EF7457B6-9B1E-4EC5-BDEA-25E7DC261F1E" Name="LastSendAt" 
                Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="TRUE" />
      <FieldRef ID="5D2E3FFC-C4FA-40CB-8DBC-57C9BFF145A4" Name="SendCount" 
                Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
      <FieldRef ID="F67BF167-FD90-42E9-88F8-65BCBF107D21" Name="ShowItem" 
                Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE"  />
      <FieldRef ID="C90B89D2-613A-4075-A2F3-5C6359363589" Name="SendAgain" 
                Required="FALSE" ShowInDisplayForm="TRUE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
    </FieldRefs>
  </ContentType>
</ContentTypes>
<Views>
  <View BaseViewID="0" Type="HTML" ReadOnly="FALSE" ContentTypeID="0x0100E2F56874-BC38-4804-81DA-64E39727CAC0" WebPartZoneID="Main" DisplayName="Newsletteransicht" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
      <FieldRef Name="Attachments" ID="30D9991A-34F3-455F-AE22-31929F68D797" ></FieldRef>
      <FieldRef Name="Title" ID="21A9B1CC-CBEA-4D8A-9AEF-0F1BD7F1BE97" ></FieldRef>
      <FieldRef Name="LastSendAt" ID="EF7457B6-9B1E-4EC5-BDEA-25E7DC261F1E" ></FieldRef>
      <FieldRef Name="SendCount" ID="5D2E3FFC-C4FA-40CB-8DBC-57C9BFF145A4" ></FieldRef>
      <FieldRef Name="ShowItem" ID="F67BF167-FD90-42E9-88F8-65BCBF107D21"></FieldRef>
      <FieldRef Name="SendAgain" ID="C90B89D2-613A-4075-A2F3-5C6359363589"></FieldRef>
    </ViewFields>
    <Query>
      <OrderBy>
        <FieldRef Name="LastSendAt" Ascending="FALSE"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
  </View>
</Views>
<Forms>
  <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
  <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
  <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
4
  • Feel like including the <Views> section? Jul 12 '12 at 15:09
  • What happens if you also add in the ID attribute into the FieldRefs in the ViewFields? Jul 12 '12 at 18:33
  • Long shot - but have you tried adding the FieldRefs in the ViewFields in the form <FieldRef Name="ShowItem" ID="..." />? Rather than an open close? I know it shouldn't make a difference - but I've found that with CAML, sometimes it does.
    – Andy Burns
    Jul 16 '12 at 10:26
  • I also tried this, but the problem is still the same.
    – Maikm88
    Jul 16 '12 at 11:45
1

Workaround found. At the moment I defined the ContentType in the ListDefinition. When I sourced it out, to an separate ContentType and referenced this in my View it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.