1

I have an issue when I create a content type, and it properly is created on the site but is not working at all on list.

I used Sharepoint Manager 2010 to watch web internals and here I am.

Here is content type as declared in solution:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Measure: Item (0x01) -->
  <ContentType ID="0x01004e96b35503e747efb4d27edab8777999"
               Name="$Resources:Type_Measure;"
               Group="$Resources:Type_Group;"
               Description="$Resources:Type_Measure_Description;"
               Inherits="FALSE" 
               Version="0">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Hidden="TRUE" Required="FALSE" DisplayName="_hiddenTitle" />
      <FieldRef ID="{E52EF588-03DE-44a6-84D9-9E0FD25F11C0}" Name="Measure_Test" />     
    </FieldRefs>
  </ContentType>

  <Field ID="{E52EF588-03DE-44a6-84D9-9E0FD25F11C0}"
         Name="Measure_Test"
         StaticName="Measure_Test"
         DisplayName="Measure_Test"
         Group="$Resources:Field_Measure_Group;"
         Type="Boolean" />
</Elements>

Inherit=TRUE do not change this behaviour.

Here is content type definition from web's AvailableContentTypes node:

  <ContentType ID="0x01004E96B35503E747EFB4D27EDAB8777999" Name="Мера" Group="Some" Version="0" FeatureId="{c32e3c2a-66c3-4466-a5e1-a248daa44499}">
    <Folder TargetName="_cts/Мера" />
    <Fields>
      <Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Name="ContentType" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ContentType" Group="_Hidden" Type="Computed" DisplayName="Тип контента" Sealed="TRUE" Sortable="FALSE" RenderXMLUsingPattern="TRUE" PITarget="MicrosoftWindowsSharePointServices" PIAttribute="ContentTypeID" Customization="">
        <FieldRefs>
          <FieldRef ID="{03e45e84-1992-4d42-9116-26f756012634}" Name="ContentTypeId" />
        </FieldRefs>
        <DisplayPattern>
          <MapToContentType>
            <Column Name="ContentTypeId" />
          </MapToContentType>
        </DisplayPattern>
      </Field>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" Group="_Hidden" Type="Text" DisplayName="_hiddenTitle" Required="FALSE" FromBaseType="TRUE" Hidden="TRUE" Customization="" />
      <Field ID="{E52EF588-03DE-44a6-84D9-9E0FD25F11C0}" Name="Measure_Test" StaticName="Measure_Test" DisplayName="Measure_Test" Group="Some" Type="Boolean" Customization="">
      </Field>
    </Fields>
    <XmlDocuments>
      <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>
    </XmlDocuments>
  </ContentType>

And here is definition in List.

  <ContentType ID="0x01004E96B35503E747EFB4D27EDAB877799900C44DB4DB0CADDE43AE87AFB9E482E1D5" Name="Мера" Group="Some" Description="" Inherits="FALSE" Version="0" FeatureId="{c32e3c2a-66c3-4466-a5e1-a248daa44499}">
    <Fields>
      <Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Type="Computed" DisplayName="Тип контента" Name="ContentType" DisplaceOnUpgrade="TRUE" RenderXMLUsingPattern="TRUE" Sortable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ContentType" Group="_Hidden" PITarget="MicrosoftWindowsSharePointServices" PIAttribute="ContentTypeID" FromBaseType="TRUE">
        <FieldRefs>
          <FieldRef Name="ContentTypeId" />
        </FieldRefs>
        <DisplayPattern>
          <MapToContentType>
            <Column Name="ContentTypeId" />
          </MapToContentType>
        </DisplayPattern>
      </Field>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="_hiddenTitle" Required="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" FromBaseType="TRUE" ColName="nvarchar1" Hidden="TRUE" />
    </Fields>
    <XmlDocuments>
      <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>
    </XmlDocuments>
  </ContentType>

As you can see, at last step this field (and all others when added) just disappears and I don't know why and how to fix it. Please, advice.


I have another similar list with content type and it works fine. I found that problem could be in <Folder TargetName="XYZ" /> tag which is missing in not working case.

4
  • Why are you using a different ID in the list? Use the same one: 0x01004e96b35503e747efb4d27edab8777999. SharePoint will manage the inheritance on it's own. – Paul Strupeikis Dec 2 '15 at 9:02
  • It IS managed by sharepoint, it's a simple guid inheritance, and I wrote only first markup. 2nd and 3rd are generated by sharepoint, based on this content type. – Alex Zhukovskiy Dec 2 '15 at 9:03
  • 1
    Thanks for clearing that out, as I thought these were snippets from the definitions made by you. – Paul Strupeikis Dec 2 '15 at 9:05
  • No problem. And there is something interesting: it doesn't work from schema, but when I remove and add content type for a list, all fields appears. So it's possible to make it work manually, but isn't from the box. – Alex Zhukovskiy Dec 2 '15 at 10:18
0

Here is an answer: it's because of Title field. I tried to hide it by using another fild with same GUID as default Title column, but it seems that SharePoint is going crazy when I do such stuff. So i removed this field and content type properly worked to me. Well, I will remove this column from the code.

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.