I am trying to create a list template in SharePoint Feature using CAML. I have two content types "News" and "News Release" they both share two fields called Overview and Description.
I have been reading that the "listtemplate" caml element does not automatically add the fields from the content types, you need to specify all the fields. When fields are specified SharePoint does not update the "Used In" in the sharepoint list settings (screenshot). This is a problem as Views can't be updated with these fields.
Could this be fixed with a feature receiver written in c#?
Any ideas?
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate Name="News"
DisplayName="News"
Description="News"
Type="100"
BaseType="0"
OnQuickLaunch="true"
SecurityBits="11"
Sequence="410"
Image="/_layouts/images/itgen.gif"
Unique="True"
DisableAttachments="True" />
</Elements>
<?xml version="1.0" encoding="utf-8" ?>
<List Name="News"
Title="News"
FolderCreation="FALSE"
Direction="$Resources:Direction;"
Url="Lists/News"
EnableContentTypes="True"
BaseType="0"
Type="100"
xmlns="http://schemas.microsoft.com/sharepoint/"
xmlns:ows="Microsoft SharePoint">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x010007196C9EB6E5B04BAE108FD1969FD42B01" />
<ContentTypeRef ID="0x010007196C9EB6E5B04BAE108FD1969FD42B02" />
</ContentTypes>
<Fields>
<Field ID="{1E061768-0380-48e4-8E71-86CAE6DDDF30}" Type="Note" DisplayName="Overview" Name="Overviews" />
<Field ID="{9406510E-511A-438f-AD9F-A55CED16B033}" Type="Note" DisplayName="Description" StaticName="Description" Name="Description" />
</Fields>
<View>
Removed For Post
</View>
<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>
</MetaData>
</List>