|
Using a timestamp sorted column in a view the order of the documents (both main and response) can be easily manipulated.
|
ShowTable of Contents
The following article demonstrates how to manipulate the order of documents in a view (both documents and responses) using a date field (or in the view, a timestamp-ordered column) and the NoteViewNavigator class in LotusScript. Create the Document Field Create a new field on the Document form and the Response form. In this example it is called reorderStamp. ReorderStamp is a date field (Editable) with the following default formula: Add a Sorted Column to the View Now that the date field is on each of the forms insert a column at the beginning of the view. Mark the column as hidden. Chose reorderStamp as the field value for the column. Sort the column in ascending order.
With a few documents created the view should look something like this:
Adding Sorting ActionsThe goal is to change the order of documents in the view yet maintain the parent/child (document/response) relationship. To do this add two action buttons to the view: Move Selected Item.. Up One and Move Selected Item .. Down One. The buttons should appear in the view action bar like so: In order to perform this move each of the action buttons will use LotusScript to swap the values of the reorderStamp in a selected view entry with one (top or bottom) of its siblings. If the entry is a response document it will move it above or below one of it's siblings. If the view entry is a document (main) then it will move it along with it's children (responses) above or below one of it's siblings. =Move Selected Item .. Up One = |