I want to turn on versioning for lists generated via a SharePoint add-in deployed to SharePoint Online. I've added VersioningEnabled = "TRUE" to the Elements.xml of each list, but still get Vision History is disabled: enter image description here

My full xml is:

<?xml version="1.0" encoding="utf-8"?>
  <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. -->
      Description="My List Definition"
      VersioningEnabled = "TRUE"

My Schema.xml is:

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

    <ContentTypeRef ID="0x01">
        <Folder TargetName="Item" />
      </ContentTypeRef><ContentTypeRef ID="0x0120" /></ContentTypes>

    <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" /></Fields>

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

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

          <FieldRef Name="Modified" Ascending="FALSE"></FieldRef></OrderBy>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
      </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>
        <RowLimit Paged="TRUE">30</RowLimit>

        <FieldRef Name="LinkTitle"></FieldRef></ViewFields>

          <FieldRef Name="ID"></FieldRef></OrderBy>
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
      <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" />

Am I missing something? Is it possible to turn on versioning for lists created via SharePoint add-in?

  • You should add VersioningEnabled="TRUE" in Scema.xml file. See this sharepointnadeem.com/2014/12/… – Nadeem Yousuf-AIS Mar 14 '18 at 12:24
  • I tried VersioningEnabled = True in the Elements.xml file, which is where list definition is stored. There is a Schema.xml file for each list in the project, but that is for metadata only (i.e. I get an error when I add a ListTemplate tag there) – dikuw Mar 15 '18 at 0:29
  • There's a List tag in the Schema.xml file. Add the attribute in there. – Nadeem Yousuf-AIS Mar 15 '18 at 2:05
  • I added it but Version Control is still disabled: <List xmlns:ows="Microsoft SharePoint" Title="Departments" FolderCreation="FALSE" VersioningEnabled = "TRUE" Direction="$Resources:Direction;" Url="Lists/Departments" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/"> – dikuw Mar 15 '18 at 11:56
  • Can you modify the list schema.xml as below and check - <List xmlns:ows="Microsoft SharePoint" Title="Departments" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Departments" VersioningEnabled="TRUE" EnableMajorVersions="TRUE" MajorVersionLimit="5" MajorWithMinorVersionLimit="5" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/"> ? – Gautam Sheth Mar 15 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.