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

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

  • 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

  • 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.

  • Dynamically changing the list item based on another list item

    Hi all,
    I have two fields that are list items.
    First list item contain two list values: Regular and One-time
    In second list item if user select the Regular then below values should appear:
    Daily wages
    Activity Linked
    Fixed Contracts.
    Contract Staff
    Outsourced
    if user select the one-time then below values should appear:
    Projects
    Repairs & Maint.
    Please do the needful.

    First list item contain two list values: Regular and One-timeYou simply need to add a conditional check to the When-List-Changed (WLC) trigger to see which value was selected. Then, as Manu suggests, you will populate the Poplist based on the selected value.
    For an example of how to dynamically populate a Poplist item, take a look at: Forms: How to Dynamically Populate a Poplist.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 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

  • One line Powershell to delete all list items?

    Is it possible to have one line powershell to delete all items in a list (no folders)?
    I tried this one from
    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/de844268-6bb5-4510-9c83-bbca24cf278f,
    $list.get_items() | where { $_.column name with spaces -like '3*' } | % { $_.Delete() }.
    In my case, I remove the middle part: $list.get_items() | % { $_.Delete() }
    I got one item removed with the exception:
    An error occurred while enumerating through a collection: Collection was modifi
    ed; enumeration operation may not execute..
    At line:1 char:1
    +  <<<< $list.Get_Items() | % {$_.Delete()}
        + CategoryInfo          : InvalidOperation: (Microsoft.Share...on+SPEnumer
       ator:SPEnumerator) [], RuntimeException
        + FullyQualifiedErrorId : BadEnumeration
    Seems I am missing some here - I am running Powershell through SharePoint 2010 Management Shell as Administrator.

    this happens because after you delete the first item, the original collection is modified.
    You can do a simple while to delete all items:
    while($list.Items.Count -gt 0){$list.Items.Delete(0)}
    Hope this could help.

  • Dynamic Population of List Item Not Working

    My requirement is to have 1 list item that is populated based on the value selected for a second list item. in the when-list-changed trigger of the second list item, i make a call to a procedure (code below). This seems to not like any of the clear_list or populate_list. the list item type is poplist. i set the class to list. if i use populate_list in when-new-form-instance, there's no problem. PLEASE HELP. When can't I populate list using a procedure??
    ERROR: frm-40734 internal error pl sql error occurred
    PROCEDURE Refresh_List IS
    v_rg_name VARCHAR2(40) := 'RGTEST';
    v_rg_id RecordGroup;
    v_sql varchar2(2048);
    problem EXCEPTION;
    status number;
    list_id item;
    BEGIN
         list_id := Find_Item('BLK_TEST.LST_TEST');
    v_sql:='select column_name from sys.all_tab_columns where table_name=''testtable''';
                   v_rg_id := Find_Group( v_rg_name );
                   IF Not Id_Null(v_rg_id) THEN
                             DELETE_GROUP( v_rg_id ) ;
                   End if;
                   clear_list(list_id);
                   v_rg_id := Create_Group_From_Query( v_rg_name, v_sql ) ;
                   status := Populate_Group( v_rg_name );
                   POPULATE_LIST(list_id, v_rg_id);
                   POPULATE_LIST('BLK_TEST.LST_TEST', 'RGTEST'); also tried this.
                   if status <> 0 then
                             raise problem;
                   end if;
              EXCEPTION
                   WHEN problem THEN
                             message('problem.');
                   WHEN others THEN
                             message('tooto');
    END;

    Thanks for the response. I've tried this example too and it still doesn't like the things mentioned in previous post. In addition, it doesn't like SET_RECORD_PROPERTY(:system.cursor_record,'EMP',status,new_status); I get the same sort of error. The form compiles fine though.
    Background on form:
    this form was created to allow users to dynamically build an update statement. On this form are a number of list items and text boxes that are not populated from a database. So the datablock doesn't retrieve values from the database and the only updating that will be done is when the user clicks an "update" button to execute the sql statement that is built. Could this issue I'm having be related to the way i designed my datablock and items? When the user selects an item from one of the list items, the record status goes to "Changed". So I assumed my issue was because of this and thought the set_record_property statement would help...but that is generating the same error. what am i missing? if i look at the index value of the record group after create_group_from_query, it is -1. after populate_group, it is still -1. should it still be -1?? any help is greatly appreciated.

  • How can I delete a list item entry based on date? Nintex workflow?

    I have a list with two columns. One of the columns in the list has a training date. I would like to delete entries in the list after the date has passed. How can I do this?
    Should I create a Nintex workflow to run everyday?  What operation in Nintex would I use to check the date in the list and then delete an entry if the current date has come?

    Murugesa,
    I have access to SharePoint Designer and also Nintex.  Are you suggesting I use SharePoint Designer instead of Nintex?  I have not used visual studio much so my knowledge with it is not good.
    You can create the simple workflow using visual studio. Drag and drop the IF else activity and Code activity to delete the item.
    Inside code activity event, Retrieve your date column value and compare against your logic date. if list column value passed then code activity executes the deletion.
    Option 2:
    If you have SPD design permission on your site,you can simply wire the same logic in the out of box workflow GUI level.
    Murugesa Pandian.,MCTS|App.Devleopment|Configure

  • Does deleting Workflow also Delete Task List Items

    I have Sharepoint 2010 and I am using the standard workflow.
    I have created a new workflow and want to delete the previous workflow to avoid use.
    If I remove the previous workflow, what happens to the items in the Task List associated with the workflow?  Do they remain undisturbed or are they also deleted.

    Hi,
    According to your post, my understanding is that you wanted to know the action of the items in the Task List associated with the deleted workflow.
    In my environment, I create a task workflow using SharePoint Designer and then start the workflow in two items. No matter whether I approve the tasks or not,
    If I delete the workflow through UI: Click the Ribbon->List->Workflow Settings->Remove a workflow, the two tasks will be disappeared in the task list. However, the workflow will be remian in the SharePoint Designer.
    If I republish the workflow in the SharePoint Designer, the workflow will be associated to the list again.
    If I delete the workflow through the SharePoint Designer, the two tasks will be also disappeared in the task list. And the workflow will be removed in the Workflow Settings.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to delet reading list items

    I've noticed I can add items to my reading list, I don't know how to delete spacific items from the list.

    First of all thank you both.
    Now I still have some problems..
    On the trigger WHEN-NEW-FORM-INSTANCE I wrote this code:
    DECLARE
    rg_fakultet RECORDGROUP;
    rg_fsmer VARCHAR2(20) := 'F_IME';
    flist_ID Item := Find_Item('SMERI.F_IME');
    nDummy NUMBER;
    BEGIN
    rg_fakultet := Find_Group(rg_fsmer);
    IF NOT Id_Null(rg_fakultet) THEN
    Delete_Group(rg_fakultet);
    END IF;
    rg_fakultet := CREATE_GROUP_FROM_QUERY(rg_fsmer,'SELECT F_IME, TO_CHAR(F_IME) FROM FAKULTETE');
    Clear_List(flist_ID);
    nDummy := Populate_Group(rg_fakultet);
    Populate_List('SMERI.F_IME',rg_fakultet);
    END;
    And it works more or less
    But, on the F_ime I wrote on trigger WHEN-LIST-CHANGED this code:
    DECLARE
    rg_smer RECORDGROUP;
    rg_ssmer VARCHAR2(20) := 'SMER';
    slist_ID Item := Find_Item('SMERI.SMER');
    nDummy NUMBER;
    BEGIN
    rg_smer := Find_Group(rg_ssmer);
    IF NOT Id_Null(rg_smer) THEN
    Delete_Group(rg_smer);
    END IF;
    rg_smer := CREATE_GROUP_FROM_QUERY(rg_ssmer,'SELECT SMER, TO_CHAR(SMER) FROM SMERI');
    Clear_List(slist_ID);
    nDummy := Populate_Group(rg_smer);
    Populate_List('SMERI.SMER',rg_smer);
    END;
    And it doesn't work, there is nothing in the item SMER.
    Can you tell me what code to write for the item SMER?
    Thanks!

  • Why cannot delete reading list items in Safari

    Environment: OS X 10.8.2
    Everytime I empty the reading list, Safari just tells me the bookmarks are syncing. Then the items reappear in reading list. I tried to disable icloud syncing and then re-enable it. It just didn't work.
    Any suggestions? Can iCloud be any better? It bothers me alot.

    Exactly same problem. Got syncing between all iOS devices but NOT on iMac...
    And items which I delete from Reading List on iMac keep returning in the list but in 'saving for offline reading...' mode.

  • Dynamically Select tile list item

    Hi,
    is it possibly to select / highlight an item in a tile list by interacting with something else in the app? So if i click a button i want to select the third itme in a tile list.
    Cheers
    Tim

    the problem is really working out which of the items I want to select, as I'm not able to loop through the children of the list in order to make my comparison.

  • How to check whether a list item is highlighted or not

    I have delete button.Have to alert the user if user does not select any itemin list
    Below is the code I have written in When Button Pressed Trigger:
    Begin
    v_currValue := NULL;
    v_currValue := Name_In('CONTROL.ENTITY_LIST');
    If (v_currValue is null) then
         v_alert_button := MSGBOX ('Select the entity type to be deleted.', 'STOP', 'Delete');
                   if v_alert_button = alert_button1 then
                        raise      v_exception ;
                             go_item('CONTROL.ENTITY_TYPE');
                   end if;
              End if;
    v_curlist_index     := Get_List_Index ('CONTROL.ENTITY_LIST');
    Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
    End
    Above code works fine means alerts the user when there are no elements in the list.
    And if there are 4 elemnts
    emp
    dept
    sal
    loc
    when clicks delete button it alerts the user to select the item
    now v_currvalue = emp;
    after deleting list contains 3 values
    but v_currvalue still remains 'emp'
    even i keep vcurrvalue = null or ''
    it is still emp.
    Is there any way to solve this or there is any bug inmy code.
    Could anyone helpme in this?
    Thanks,

    b]/** First approach which didnt worked **/     
    Begin
    v_currValue := to_char(' ');
    v_currValue := Name_In('CONTROL.ENTITY_LIST');
    If (v_currValue is null) then
    v_alert_button := MSGBOX ('Select the entity type to be deleted.', 'STOP', 'Delete');
    if v_alert_button = alert_button1 then
    raise v_exception ;
    go_item('CONTROL.ENTITY_TYPE');
    end if;
    End if;
    v_curlist_index := Get_List_Index ('CONTROL.ENTITY_LIST');
    Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
    End
    Above is my previous code
    I want to alert the user by using v_currvalue
    /** Second type of approachwhich worked **/     
         /* Retrieves the index of the current item in the list */
         v_curlist_index     := Get_List_Index ('CONTROL.ENTITY_LIST');
              /* Alert the user if list item is not selected */
         If( (     v_curlist_index = 0     ))then
         v_alert_button := MSGBOX ('Select the entity list item to be deleted.', 'STOP', 'Delete');
                   if v_alert_button = alert_button1 then
                             go_item('CONTROL.ENTITY_LIST');
                   end if;
         Else
                   /* Deletes the list item */
    Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
         End if;
    Want to know why my first approach not working
    Thanks,

Maybe you are looking for