1

I created via xml declaration a content type which is based on the folder content type. I set "inherits=FALSE" due to the declaratively adding of event receivers to the content type.
My Problem now is that the content type is not showing the custom fields which I added as well to the content type the only thing which is showing up is for example the standard NewForm for Folders:

enter image description here

Has anyone an idea why the content type is behaving like this? In PowerShell I can manipulate the fields of an created Item as I which but the forms are not showing these fields.
Even if I add some additional fields to the list content type there is no change to the forms at all.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Folder (0x0120) -->
  <ContentType ID="0x012000XXX" Name="Work Package" Group="CTS" Description="Work Package Content Type based on Folder" 
        Inherits="FALSE" Version="0" Hidden="TRUE" Overwrite="TRUE">
    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
        <Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
          <Receiver>
            <Name>ItemAdded</Name>
            <Type>ItemAdded</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>$SharePoint.Type.xxx.FullName$</Class>
            <Data></Data>
            <Filter></Filter>
            <Synchronization>Synchronous</Synchronization>
          </Receiver>
          <Receiver>
            <Name>ItemDeleting</Name>
            <Type>ItemDeleting</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>$SharePoint.Type.xxx.FullName$</Class>
            <Data></Data>
            <Filter></Filter>
          </Receiver>
          <Receiver>
            <Name>ItemUpdating</Name>
            <Type>ItemUpdating</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>$SharePoint.Type.xxx.FullName$</Class>
            <Data></Data>
            <Filter></Filter>
          </Receiver>
          <Receiver>
            <Name>ItemUpdated</Name>
            <Type>ItemUpdated</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>$SharePoint.Type.xxx.FullName$</Class>
            <Data></Data>
            <Filter></Filter>
            <Synchronization>Synchronous</Synchronization>
          </Receiver>
        </Receivers>
      </XmlDocument>
    </XmlDocuments>
    <FieldRefs>
      <FieldRef ID="{xxx}" DisplayName="Work Package" ShowInNewForm="FALSE" ShowInEditForm="FALSE" Hidden="TRUE" Name="Title" />
      <FieldRef ID="{xxx}" DisplayName="Work Package ID" Required="TRUE" Name="WorkPackageID" />
      <FieldRef ID="{xxx}" DisplayName="Work Package Title" Required="FALSE" Name="WorkPackageTitle" />
      <FieldRef ID="{xxx}" DisplayName="Lead" Required="TRUE" Name="Lead" />
      <FieldRef ID="{xxx}" DisplayName="Part" Required="FALSE" Name="Part" />     
    </FieldRefs>
  </ContentType>
</Elements>

UPDATE: The issue is only occurring in Document Libraries, if I add this content type to a custom list, all fields are showing up correctly.
In addition to that SharePoint is totally ignoring the required property at the content type. Therefore it seems that it is not processing the at all.

8
  • You added custom fields to the Parent Folder content type or the one you want to use?
    – Asad Refai
    Commented Sep 28, 2015 at 8:54
  • No I created a new Content Type based on the Folder Content Type and used this in lists.
    – Husen
    Commented Sep 28, 2015 at 9:02
  • And these custom fields you added into the new content type right?
    – Asad Refai
    Commented Sep 28, 2015 at 9:05
  • what happens if you add the attribute ShowInNewForm = true and ShowInEditForm = true?
    – Gwny
    Commented Sep 28, 2015 at 9:07
  • So in you list/library you must be having more than 1 content type now. You need to make sure you select correct content type from the new button on ribbon control. As the default CT is ITEM and it has only Title column.
    – Asad Refai
    Commented Sep 28, 2015 at 9:14

1 Answer 1

1

For those of you who have the same problem. I guess I found the solution.
In the declaration there is the definition of the Forms missing. If you add it as a xml document to the elements.xml

<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
    <Display>ListForm</Display>
    <Edit>ListForm</Edit>
    <New>ListForm</New>
  </FormTemplates>
</XmlDocument>

It works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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