Sorting a particular column in a view

Hi everyone,

I am having problem in sorting a column in a view using lotus script.

I have a view called “vwPeopleByName” with “Names” as the first column and i need to sort by this column. I halso have a $$SearchTemplateforvwPeopleByName form with $$viewbody having this view. I am keeping a button in the $$SEarchTemplate to trigger an agent when the form gets loaded in the web.

The agent is as follows:

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim vc As NotesViewColumn

Dim doc As NotesDocument

Set db=session.CurrentDatabase

Set view=db.GetView(“vwPeopleByName”)

Set vc = view.Columns(0)

Set doc = view.GetFirstDocument

While Not (doc Is Nothing)

eval = |session.Evaluate(“@Sort(view.Columns(0);[ASCENDING])”)|

Call doc.ReplaceItemValue(“Name”, eval)

Call doc.Save(True, False)

Set doc = view.GetNextDocument(doc)

Wend

Call view.Refresh

End Sub

However this sorting is not reflecting in my web page.

Please help me. I need help urgently.

Thanks in advance