Next, set the view's autoupdate property to false. The view should not update until the action completes.
The actions in this example are set up to only move one document at a time (parents do move with their children though). Check to make sure that the view is not empty, that only one view entry is select and that the view entry selected is not already at the top of the view:
Set dc = db.UnprocessedDocuments
If (dc.Count() = 0 ) Then
Msgbox "Nothing in the view", 48, "View Empty"
Exit Sub
Elseif (dc.Count() > 1) Then
Msgbox "You can only move one item at a time!",48, "New Number Warning"
Exit Sub
End If
Set selected = dc.GetFirstDocument()
'Parent document: check for it being the first entry
Set entry = nav.GetFirst
If (entry.NoteID = selected.NoteID ) Then
Msgbox "This item is already at the top." , 48, "Top Level Item"
Exit Sub
End If
'Response documents: check to see if the selected doc is the first Child
Do While Not(entry Is Nothing)
If (selected.NoteID = entry.NoteID ) Then
Exit Do
End If
Set entry = nav.GetNext(entry)
Loop
If (entry Is Nothing) Then
Exit Sub
End If
Set entry = nav.GetPrevSibling(entry)
If (entry Is Nothing) Then
Msgbox "This item is already at the top of its level." , 48, "Top Level Item"
Exit Sub
End If
Set reorderStampTime = s.CreateDateTime(entry.Document.getITemValue("reorderStamp")(0))
Dim entryDoc As NotesDocument
Set entryDoc = entry.Document
Call entryDoc.CopyItem(selected.GetFirstItem("reorderStamp"), "reorderStamp")
Call entryDoc.Save(False, False)
Set selected.reorderStamp = reorderStampTime
Call selected.Save(False,False)
Call ws.ViewRefresh