2

I have created a SharePoint project in Visual Studio 2010 using the SharePoint 2010 empty project template and have added a ContentType project item and populated the generated elements.xml with the required fields. When I press to deploy and debug the solution/feature to my SharePoint 2010 Team site, I can see the new site columns as well as the custom content type. However, when I click on the content type, only two fields are listed under the content type columns (Title, Date Logged). The other fields are missing even though I can see them when I goto Site Columns. Could someone please help me get my columns show up.

Elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Date Logged -->
  <Field ID="{F04AAD0C-56DC-4EFE-AA5E-1C984F352518}"
     Name="DateLogged"
     DisplayName="Date Logged"
     Type="DateTime"
     Required="TRUE"
     Group="Shingi Columns" />
  <!-- Date Received -->
  <Field ID="{4347C6B1-8C38-4859-83F5-43E962440868}"
     Name="DateReceived"
     DisplayName="Date Received"
     Type="DateTime"
     Required="TRUE"
     Group="Shingi Columns" />
  <!-- Action -->
  <Field ID="{7A476F0E-8719-441A-BB9F-B52F2040022C}"
     Name="Action"
     DisplayName="Action"
     Required="TRUE"
     Type="Choice"
     Group="Shingi Columns">
<CHOICES>
  <CHOICE>Weekend Meeting</CHOICE>
  <CHOICE>Information</CHOICE>
  <CHOICE>File</CHOICE>
</CHOICES>
</Field>
<!-- Date Action Required -->
<Field ID="{34773B19-7443-47E2-9BEB-3A4B7F13B645}"
     Name="DateActionRequired"
     DisplayName="Date Action Required"
     Type="DateTime"
     Required="FALSE"
     Group="Shingi Columns" />
<!-- Action Comment -->
<Field ID="{D2AC4E9B-C91F-4622-A8C9-0E305E6CD8E5}"
     Name="ActionComment"
     DisplayName="Action Comment"
     Required="FALSE"
     Type="Text"
     Mult="FALSE"
     Group="Shingi Columns"/>
<!-- Date Action Completed -->
<Field ID="{67D1F5B1-B45C-448E-8CA5-75F043258D7E}"
     Name="DateActionCompleted"
     DisplayName="Date Action Completed"
     Type="DateTime"
     Required="FALSE"
     Group="Shingi Columns"/>
<!-- Document Direction -->
<Field ID="{9C299634-18DF-41C2-BEA9-C37AC7942589}"
     Name="DocumentDirection"
     DisplayName="Document Direction"
     Type ="Choice"
     Required="TRUE"
     Group="Shingi Columns">
  <CHOICES>
    <CHOICE>Inward</CHOICE>
    <CHOICE>Outward</CHOICE>
  </CHOICES>
</Field>
<!-- Forwarded to -->
<Field ID="{C097876C-2C59-4306-909E-5D8858A913B3}"
     Name="ForwardedTo"
     DisplayName="Forwarded To"
     Type ="Choice"
     Required="TRUE"
     Group="Shingi Columns">
  <CHOICES>
    <CHOICE>Manager One</CHOICE>
    <CHOICE>Manager Two</CHOICE>
  </CHOICES>
</Field>

<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x0100d6ad22b896a147aa8a0103451e7fc71b"
           Name="Shingi Correspondence"
           Group="Shingi Correspondence Content Types"
           Description="My Correspondence Content Type"
           Inherits="TRUE"
           Version="0">
  <FieldRefs>
    <FieldRef ID="{F04AAD0C-56DC-4EFE-AA5E-1C984F352518}" Name="DateLogged" />
    <!-- Date Received -->
    <FieldRef ID="{4347C6B1-8C38-4859-83F5-43E962440868}" Name="DateReceived" />
    <!-- Action -->
    <FieldRef ID="{7A476F0E-8719-441A-BB9F-B52F2040022C}" Name="Action" />
    <!-- Date Action Required -->
    <FieldRef ID="{34773B19-7443-47E2-9BEB-3A4B7F13B645}" Name="DateActionRequired" />
    <!-- Action Comment -->
    <FieldRef ID="{D2AC4E9B-C91F-4622-A8C9-0E305E6CD8E5}" Name="ActionComment" />
    <!-- Date Action Completed -->
    <FieldRef ID="{67D1F5B1-B45C-448E-8CA5-75F043258D7E}" Name="DateActionCompleted" />
    <!-- Document Direction -->
    <FieldRef ID="{9C299634-18DF-41C2-BEA9-C37AC7942589}" Name="DocumentDirection" />
    <!-- Forwarded To -->
    <FieldRef ID="{C097876C-2C59-4306-909E-5D8858A913B3}" Name="ForwardedTo" />
  </FieldRefs>
</ContentType>

1 Answer 1

2

Remove the comments inside your field and field refs. The XML parser is... well...lets just say lacking! It doesnt like comments for certain fields. I see this behaviour for several kind of artifacts, including the above mentioned.

Annoying, since it makes perfect sense to describe what you do.

Your Answer

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