ListIterator.delete Method [AX 2012]

Removes the element that is pointed to by the iterator from the list.

public void delete()

Run On

Called

The iterator will point to the next element after the deletion.

The following example creates a list that contains three elements and prints a description of the elements in the list. It then deletes the first element in the list and prints a description of the remaining elements.

{ 
    List li = new List(Types::Integer); 
    ListIterator it; 
  
    li.addStart(1); 
    li.addStart(2); 
    li.addStart(3); 
    print li.toString(); 
  
    it = new ListIterator(li); 
    it.delete(); 
    print li.toString(); 
    pause; 
}

Community Additions

ADD
Show: