Dynamic view creation

Hi,

I created a view at run time using lotus script. But I am not able to

open that view just after its creation. I need to close the

application and reopen it, then only the newly created view is getting

into the work space object. Following is my code, Please help me…

Dim s As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim v As NotesView

Dim uiv As NotesUIView

Dim uidoc As NotesUIDocument

Dim form As NotesForm

Dim uidb As NotesUIDatabase

Set db = s.CurrentDatabase

Set uidoc=ws.CurrentDocument

Set uidb=ws.GetCurrentDatabase

Set v=db.CreateView(“tempView”)

v.SelectionFormula=“SELECT form=‘frmAddMember’”

v.Refresh

ws.ViewRefresh

db.DelayUpdates=False

Call ws.OutlineReload(“”,“”)

Call ws.ReloadWindow

'Call ws.RefreshParentNote

Set db=Nothing

Set uidb=ws.GetCurrentDatabase

Set v=Nothing

Set uidb=Nothing

Set db= s.CurrentDatabase

Set v=db.GetView(“tempView”)

'Msgbox v.AllEntries.Count

Call ws.OpenDatabase(“”,“Test.nsf”,“tempView”)

Call uidb.OpenView(v.Name,“”,1)

Subject: View

Try to loop over the db.Views to see if it exist, also try to close and reopen the database object,before the ui.

Regards

Tamir Ben Shoshan

http://www.systbs.com

SharePoint & Lotus plugins & Notes CAPI