4

I am trying to create a SharePoint list declaratively but I have the error above.

According to this site I should put the feature id on the list instance xml definition, but after doing it, the error persists.

My idea is just to create a custom list with a content type.

The code I used its the one generated automatically by VS 2012

List Instance elements

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List project item, an error will occur when the project is run. -->
    <ListTemplate
        Name="List1"
        Type="10000"
        BaseType="0"
        OnQuickLaunch="TRUE"
        SecurityBits="11"
        Sequence="410"
        DisplayName="List1"
        Description="My List Definition"
        Image="/_layouts/15/images/itgen.png"/>
</Elements>

Schema xml

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="List1" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/List1" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/" EnableContentTypes="TRUE">
  <MetaData>
    <ContentTypes>


    <ContentTypeRef ID="0x01">
        <Folder TargetName="Item" />
      </ContentTypeRef><ContentTypeRef ID="0x0120" /><ContentType ID="0x0100D17B974BA3B04BA6B1A80917DFB7F32A" Name="CT01" Group="Custom Content Types" Description="My Content Type" Inherits="TRUE" Version="0"><FieldRefs><FieldRef ID="{88903efe-ef05-4e72-b8be-1e89fb1920e3}" DisplayName="Status" Required="FALSE" Name="yyy_Status" /><FieldRef ID="{46E2BB3D-79C9-47BF-B267-275A53686DBB}" DisplayName="Start date" Required="TRUE" Name="yyy_StartDate" /><FieldRef ID="{8C90E0D3-80E3-4089-AD2C-F205B736BF50}" DisplayName="First name" Required="TRUE" Name="yyy_FirstName" /></FieldRefs></ContentType></ContentTypes>
    <Fields>

    <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="$Resources:core,Title;" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" /><Field ID="{88903efe-ef05-4e72-b8be-1e89fb1920e3}" StaticName="yyy_Status" Name="yyy_Status" DisplayName="Status" Type="Choice" Required="FALSE" Group="Test Site Columns"><CHOICES><CHOICE>Active</CHOICE><CHOICE>Completed</CHOICE><CHOICE>Archived</CHOICE></CHOICES></Field><Field ID="{46E2BB3D-79C9-47BF-B267-275A53686DBB}" StaticName="yyy_StartDate" Name="yyy_StartDate" DisplayName="Start date" Type="DateTime" Required="TRUE" Group="Test Site Columns"></Field><Field ID="{8C90E0D3-80E3-4089-AD2C-F205B736BF50}" StaticName="yyy_FistName" Name="yyy_FirstName" DisplayName="First name" Type="Text" Required="TRUE" Group="Test Site Columns"></Field></Fields>
    <Views>


    <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>

        <FieldRef Name="LinkTitleNoMenu"></FieldRef></ViewFields>
        <Query>
          <OrderBy>

          <FieldRef Name="Modified" Ascending="FALSE"></FieldRef></OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
        </ParameterBindings>
      </View><View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/generic.png?rev=23" Url="AllItems.aspx">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <JSLink>clienttemplates.js</JSLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>

        <FieldRef Name="LinkTitle"></FieldRef><FieldRef Name="yyy_Status" /><FieldRef Name="yyy_StartDate" /><FieldRef Name="yyy_FirstName" /></ViewFields>
        <Query>
          <OrderBy>

          <FieldRef Name="ID"></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>
  </MetaData>
</List>

List Instance xml

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="List1" OnQuickLaunch="TRUE" TemplateType="10000" Url="Lists/List1" Description="My List Instance" FeatureId="b36d6a54-4171-4a0b-8902-18b73505ac02"></ListInstance>
</Elements>

and the feature

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="yyy - Test - List" ActivateOnDefault="FALSE" Id="b36d6a54-4171-4a0b-8902-18b73505ac02" Scope="Web" Version="1.0.0.0">
  <ElementManifests>
    <ElementManifest Location="List1Instance\Elements.xml" />
    <ElementManifest Location="List1\Elements.xml" />
    <ElementFile Location="List1\Schema.xml" />
  </ElementManifests>
</Feature>
0

I had the same problem. It went away after I added a FeatureID property to the ListInstance element and set it to the ID of the sitefeature that contained the listtemplate.

| improve this answer | |
  • Dunno why this is downvoted. It's a valid possible solution. – LeonidasFett Feb 28 '17 at 15:41
0
| Feature ID                           | Name                           | List Template |
|--------------------------------------|--------------------------------|---------------|
| 00bfea71-e717-4e80-aa17-d0c71b360101 | Document Library               | 101           |
| 00bfea71-1e1d-4562-b56a-f05371bb0115 | Form Library                   | 115           |
| 00bfea71-c796-4402-9f2f-0eb9a6e71b18 | Wiki Page Library              | 119           |
| 00bfea71-52d4-45b3-b544-b1c71b620109 | Picture Library                | 109           |
| 2510d73f-7109-4ccc-8a1c-314894deeb3a | Report Library                 | 433           |
| 29d85c25-170c-4df9-a641-12db0b9d4130 | Translation Management Library | 1300          |
| 00bfea71-dbd7-4f72-b8cb-da7ac0440130 | Data Connection Library        | 130           |
| 0be49fe9-9bc9-409d-abf9-702753bd878d | Slide Library                  | 2100          |
| 00bfea71-d1ce-42de-9c63-a44004ce0104 | Announcements                  | 104           |
| 00bfea71-7e6d-4186-9ba8-c047ac750105 | Contacts                       | 105           |
| 00bfea71-6a49-43fa-b535-d15c05500108 | Discussion Board               | 108           |
| 00bfea71-2062-426c-90bf-714c59600103 | Links                          | 103           |
| 00bfea71-ec85-4903-972d-ebe475780106 | Calendar                       | 106           |
| 00bfea71-a83e-497e-9ba0-7a5c597d0107 | Tasks                          | 107           |
| 00bfea71-513d-4ca0-96c2-6a47775c0119 | Project Tasks                  | 150           |
| 00bfea71-5932-4f9c-ad71-1557e5751100 | Issue Tracking                 | 1100          |
| 00bfea71-eb8a-40b1-80c7-506be7590102 | Survey                         | 102           |
| 00bfea71-de22-43b2-a848-c05709900100 | Custom List                    | 100           |
| 00bfea71-3a1d-41d3-a0ee-651d11570120 | Custom List in Datasheet View  | 120           |
| 29d85c25-170c-4df9-a641-12db0b9d4130 | Languages and Translators      | 1301          |
| 065c78be-5231-477e-a972-14177cc5b3c7 | KPI List                       | 432           |

Source: https://blogs.technet.microsoft.com/vinitt/2009/11/04/list-of-feature-id-listtemplate/

| improve this answer | |

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.