Deleting a List Item with Very Huge Amount of Versions

A faulty workflow flooded list items with 50K+ versions on SharePoint List. Attempts to open the list item/delete/edit via SharePoint UI/PowerShell failed! Programmatic iterations to delete versions/items trys to consume complete server memory and
fails.
Deleting the complete list is successful, but that results in SharePoint timer jobs fail and places Lots of Block in the database, which stops SharePoint sites from loading.
Any help please?

SP 2010 and 2013 support a max of 50,000 versions. Accessing more than 5000 items at a time causes SQL Server to escalate from row locks to table locks, which will generally bring SharePoint to a stop. You will need to write code that can bring back subsets
of the data, and the only approach I can think of is a CAML query. But, I can't find any examples of working with versions using CAML.
You could just change the Throttling settings in Central Admin from the default of 5000 to 50000 and then run your code during off hours.
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner

Similar Messages

  • How to delete a list-item with Contribute 4

    I use Contribute for a lot of my client for years and a few
    weeks ago i installed Contribute 4 for the first time for a new
    client .We dicovered that it's difficult or impossible to delete a
    list-item in a unordered list. Maybe also in other list-types but
    we haven't tried this yet. Does anybody know how to delete a
    list-item? In Contribute 3 you just had to use the backspace button
    but that isn't working anymore.
    Thanks for your help.
    Maarten Strik
    www.strikdesign.nl

    http://linesofcode.net/snippets/166

  • Any suggestions how can I delete or archive items with DocTitle as *.html ?

    Any suggestions how can I delete or archive items with DocTitle as *.html ? These are the email templates checked in by Fusion Apps, and all I know are the DocTitles.
    Archive servervice seems a better way to delete items at same time keep a backup. but not sure what's the correct way to setup/use the "aExportQuery" parameter. Seems it's been ignored from the ADD_ARCHIVE and EXPORT_ARCHIVE idccommands, codes listed below.
    @Properties LocalData
    IdcService=ADD_ARCHIVE
    IDC_Name=CommonDomain_ucm11g_cs
    aArchiveName=archive_test
    aArchiveDescription=this is an archive test
    aCopyWebDocuments=0
    aDoReplace=0
    aExportQuery=Standard Query ValuePanel UseExportDate 0 AllowExportPublished 0 AllRevisions 1 LatestRevisions 0 NotLatestRevisions 0 MostRecentMatching 0 CurrentIndex 0 Clauses dDocTitle:contains:.html CustomQuery dDocTitle%LIKE%'#%.html#%' IsCustom 0
    @end
    @Properties LocalData
    IdcService=EXPORT_ARCHIVE
    aArchiveName=archive_emt
    IDC_Name=CommonDomain_ucm11g_cs
    aExportQuery=Standard Query ValuePanel UseExportDate 0 AllowExportPublished 0 AllRevisions 1 LatestRevisions 0 NotLatestRevisions 0 MostRecentMatching 0 CurrentIndex 0 Clauses dDocTitle:contains:.html CustomQuery dDocTitle%LIKE%'#%.html#%' IsCustom 0
    dataSource=RevisionIDs
    aDoDelete=1
    @end
    <<EOD>>

    You could use the Archiver app. You can use that app as-needed or set it up so that all items are setup to delete once they're checked in.
    -ryan

  • Error: "The workflow could not delete the list item"

    Have set up 2 lists:  Events and EventsArchive.  They have all the same fields.  I have created a workflow in SPD using an impersonation step (I have Full control of the site/site collection).  Workflow is essentially this:
        If Curent Item:Expired 
    equals
    Yes
           Copy item in Current Item to
    EventsArchive
           then Delete item in
    Current Item.
    The item is copying over to the EventsArchive list just fine, but the "delete" part is not happening.  Instead, I get the following error:
    The workflow could not delete the list item. Make sure the list exists and the user has permissions to delete items in the list.
    The list obviously exists (or I wouldn't be able to copy an item from it), and I have as much permissions as anyone can have, so I'm not sure where else to turn with this. 
    Thanks in advance for your help!

    Hi,
    To test the issue, I create a simple workflow without using Impersonation step:
    It works.
    Could you please create new lists to avoid custom settings and test the issue again?
    Similar thread:
    https://social.msdn.microsoft.com/Forums/office/en-US/3fa94026-4487-4e4c-a5b4-12a79d6ee6a2/workflow-delete-item-not-working?forum=sharepointcustomizationprevious
    Regards,  
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • What is the best approach to delete multiple list items

    Hi
    I want to delete multiple list items at once, what is best approach please suggest?
    Ramesh

    Hi Ramesh,
    Better approach for removing many items from a list is to use the ProcessBatchData method provided by the SPWeb class. First, you need a collection of the list items
    you want to remove, and then you can use the Get-SPListItem function to retrieve a list of items that match a given criteria. Then build a batch string with resultant items and call the ProcessBatchData method.
    Here is the sample code.
    function Get-SPList($webUrl, $lstUrl)
    $webObj = Get-SPWeb -identity $webUrl
    $lstObj = $webObj.GetList($lstUrl);
    return $lstObj
    $spList = Get-SPList -webUrl "http://mysitecollecton/MySite" -lstUrl "http://mysitecollecton/MySite/Lists/EmpInfo"
    $spQuery = new-object Microsoft.SharePoint.SPQuery
    $camlQuery =
    "<Where>
    <Eq>
    <FieldRef Name='Department' />
    <Value Type='Text'>HR</Value>
    </Eq>
    </Where>"
    $spQuery.Query = $camlQuery
    $spQuery.RowLimit = 100
    $spListItemCollection = $spList.GetItems($spQuery)
    # Create batch remove CAML query
    $batchRemove = '<?xml version="1.0" encoding="UTF-8"?><Batch>';
    # The command is used for each list item retrieved
    $command = '<Method><SetList Scope="Request">' +
    $spList.ID +'</SetList><SetVar Name="ID">{0}</SetVar>' +
    '<SetVar Name="Cmd">Delete</SetVar></Method>';
    foreach ($item in $spListItemCollection)
    $batchRemove += $command -f $item.Id;
    $batchRemove += "</Batch>";
    # Remove the list items using the batch command
    $spList.ParentWeb.ProcessBatchData($batchRemove) | Out-Null
    Please don't forget to mark it answered, if your problem resolved or helpful.

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

  • SharePoint Designer 2013 (2010 Platform Workflow) - How can I create a new list item with a SPECIFIC content type?

    In SharePoint 2010 I created workflows that used the 'Create list Item' Action, which then set the Content Type ID (so I could create documents of various types in a document library). 
    We just switched to the SharePoint 2013 platform, and now the drop down for Content Type ID is blank in all of the workflows that are still using the SharePoint 2010 platform.  Is there any way to create a list item with specific content
    type?  Even if I could just input a string into that field instead of using this blank drop-down.  Please help! 

    Hi Sarah,
    According to your description, my understanding is that you cannot create a new list item with a specific content type using SharePoint 2010 Platform Workflow.
    I tested the same scenario in my environment, and the Create List Item worked fine with the specific content type.
    How did you create the content type?
    Please check if the content type is added to the list/library the workflow associated with.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Customising a SharePoint list content type form - "Manage multiple list items with this form"

    I have designed a form for a content type on an existing SharePoint list.  When I ran the initial wizard, I selected
    Manage multiple list items with this form which is great, exactly what I want.
    But, there are some columns in this content type that I do not want repeating and have them moved them outside of the Repeating Section but I am getting the below error.  I can't seem to find a way to create a new non-repeating group though.  Any
    advice on how to do this?

    *Bump*

  • GL Line Item with Tax Base Amount Posting

    Dear Expert,
    I have a GL account with tax and CO object. And, I am using BAPI_ACC_DOCUMENT_POST to do the GL posting. I would like to post the GL line item with tax base amount as it will show in FB03 line item, the posting is successful but no base amount is in GL line item in FB03. (I can manually post it in Tcode FB50).
    Any idea on this and what is the problem? Appreciate if can help..
    Thank you.
    Best Regards,
    Weng

    Hello Weng,
    I also looked on SAP notes. 
    There is a note with much information about Tax Postings with accounting BAPIs and it's a consulting note.  The note number is 626235.
    Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Dec 21, 2010 10:11 PM

  • Populate list Item with a recordgroup?

    Hi Friend
    I want to populate a list Item with a "Recordgroup". Does it possible without using the add_eliment function?
    I did it through the Loop to read the item from record group. If the database changes the record does not change in my list item. because the list containing the added items which was delivered in the load time. But like Pressing F9, we can easily see the last changed data of the database.
    If possible please send me the detail code to me. Here I delivered the detail procedure which i did for that purpose.
    Farhad
    ==========================================================
    PROCEDURE Populate_Item_In_List (     List_name VARCHAR2,
                                                                                         QUERY_Text VARCHAR2,
                                                                                         rg_Level_Col_name VARCHAR2,
                                                                                         rg_Value_Col_name VARCHAR2) IS
         HERE THE PROCEDURE POPULATE THE LIST WITH THE REQUIRED DATA UNDER A CORRCET SQL (SELECT) COMMAND
         List_name                     THE LIST ITEM WHICH HAS TO BE LOADED BY THIS PROCEDURE
         QUERY_Text                     THIS CONTAINS THE QUERY TEXT BY WHICH THE LIST ITEM WILL LOAD
         rg_Level_Col_name THIS IS THE LEVEL OF THE REQUIRED ITEM THAT OBVIUSLY A CHAR DATA TO BE RETRIVE
         rg_Value_Col_name THIS IS THE VALUE OF THE REQUIRED ITEM THAT OBVIUSLY A NUMBER DATA TO BE RETRIVE
                   R_Group          RecordGroup;
                   Rowcount      NUMBER;
                   rg_name      VARCHAR2(40) := 'DefaultRG';
                   rg_id      RecordGroup;
                   errcode      NUMBER;
                   Lid                    Item;
    BEGIN
         --+++++++++++++++++++++THIS IS USED TO POPULATE THE RECORD GROUP+++++++++++++++++++++++++++++++++
                   rg_id := Find_Group(rg_name);                                             Find the record group                                                   +
                                                      --+
                   IF Id_Null(rg_id) THEN                                                                                                                                                                          --+
                             rg_id := Create_Group_From_Query(rg_name,Query_Text);                                                                                     --+
                             errcode := Populate_Group(rg_id);                                                                                                                                       --+
                   else                                                                                                                                                                                                                       --+
                             errcode := Populate_Group_With_Query(rg_id,Query_Text);                                                                            --+
                   END IF;                                                                                                                                                                                                                  --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
              If errcode = 1403 then
                   Message('There is no data to be retrive......');
              else
         --+++++++++++++++++++++THIS IS USED FOR LOADING DATA TO THE LIST ITEM++++++++++++++++++++++++++++
                   Rowcount      :=      Get_Group_Row_Count(rg_id);                              Counting the total rows in RGroup          +
                   Lid                    :=     Find_Item(List_name);                                                                                                                                            --+
                   Clear_list(Lid);                                                                                          Clear the list which is loaded now     +
                   FOR J IN 1..Rowcount LOOP                                                                                                                                                                     --+
         Add_List_Element(List_name,                                                            the name of the list item                              +
                                                      J,                                                                                index of the list                                                  +
                                                      Get_Group_Char_Cell('DefaultRG.'||rg_Level_Col_name,j),     Level of item+
                                                      Get_Group_Number_Cell('DefaultRG.'||rg_Value_Col_name,j) value of item+
                                                      );                                                                                                                                                                               --+
                   END LOOP;                                                                                                                                                                                                             --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              end if;
    END;
    ===============================================================

    Hi Farhad,
    You can make use of Populate_List built-in.
    Populate_List(list_id, 'RECGRP');
    You can find more information in online documentation of forms.
    Cheers
    Zakiy

  • Populate HTML LIST ITEM with a query

    Hello,
    I've a problem,
    I'm building a portlet based on an html form.
    In this forms there are several list items,
    How can I populate an html list item with a dynamic query based on a db table?

    I hope you are looking for something like this
    declare
    v_ret_string varchar2(32767);
    begin
    v_ret_string := ' <TABLE BORDER="1" bordercolor="#0000FF" bgcolor="#FFFFF0">
                   <TR><TD><TABLE BORDER="0" CELLSPACING="3" CELLPADDING="0">
                   <BR>
                        <TR><TD ALIGN=middle><SELECT SIZE="1" NAME="emp_list">
                             <OPTION VALUE="">';
    For get_emp_list In (Select ENAME,EMPNO
    From SCOTT.EMP
              Order by ENAME) Loop
    v_ret_string := v_ret_string || '<OPTION VALUE="'||get_emp_list.EMPNO||'">'||get_emp_list.ENAME;
    End Loop;
    v_ret_string := '</SELECT></TD></TR><TABLE></TABLE>';
    End;
    which uses PL/SQL code to generate the html page.
    Thanks
    -Krishnamurthy

  • How to Populate a List item with LOV'S

    How to Populate a list of items with Lov's
    and then how to dynamically change the Values of one LIST Item
    Based on the Value of anothe List item

    976798 wrote:
    --Hello..I want to ask that How to bind a list item with  table values? this below code does not populate items from database to list item.Pls any body give me solution.
    declare
         group_id RecordGroup;
         list_id Item:=Find_Item('LST_CLASS');
         status number;
    begin
         group_id:=Create_Group_From_Query('Answer_List','select CLASS_ID,CLASS_NM from CLASS_MSTR');
         status:=Populate_Group('Answer_List');
         message(to_char(status));
         Populate_List(list_id,group_id);
         end;Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    Check this link: How to Dynamically Populate a Pop List ?
    Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • How to delete a list item in Sharepoint 2007 via SOAP?

    I am looking to delete a list item using soap web services. I am using the Lists.asmx web service.
    The XML looks like this:
    <Batch OnError="Continue" ListVersion="1">
    <Method ID="1" Cmd="Delete">
    <Field Name="ID">7</Field>
    </Method>
    </Batch>
    I got this from the msdn docs at http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems%28v=office.12%29.aspx
    And I am using the Lists.UpdateListItems Method.
    I am doing this in python and python has a library, suds for this purpose. However I get this exception:
    suds.WebFault: Server raised fault: 'Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.'
    I have looked for typos, and verified the XML format. Where am I going wrong?
    Some help please.

    http://linesofcode.net/snippets/166

  • Dynamically deleting a List Item

    i have a doubt as to can we dynamically delete a element in a List Item. I know, adding elements in a list but, can we delete it.
    I hope, my question is clear. Please help in solving the doubt.
    Regards.

    hi
    I Have filled 10 list dynamically with same records of a table from database. If user selected anyone record from 1st list,that item will not appear in next 9 list.again on selection of item in 2nd list,that item will not appear in next 8 list.....and so on.....I try to use DELETE_LIST_ELEMENT() but here how i can provide dynamically index value of item in list

  • Populating list item with a record group

    I'm trying to populate a list item (TList) with a Record group with a simple query: SELECT FRM_NAME FROM FORM
    In the forms WHEN_VALIDATE_NEW_FORM trigger, I use POPULATE_LIST('FORM_LIST', 'RG_FORM_LIST');
    Am I missing something? I get the error FRM-41334: Invalid record group for list population.

    thanks, i've tried that, but still nothing. I must be doing something simple, but very wrong. I tried with oracle's default scott/tiger schema, created a simple form with a record group with 2 columns, and populating a manually made poplist (populate_list('LIST4', 'RG1'); Still get errors:
    FRM-30191: No list items defined for required poplist.
    List LIST4
    Item: LIST4
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.

Maybe you are looking for