Search code examples
lotus-noteslotus-dominolotusscriptlotuslotus-formula

LotusNotes: db.GetView() returns nothing


I have a view called "mpending". I am trying to get the view in an agent. Here is the code snippet of how I am doing it:

Dim db As NotesDatabase
Set db = New NotesDatabase("","app.nsf")
Dim view As NotesView
Set view = db.GetView("mpending")

Then the view is assigned with nothing.

I am quite new to LotusNotes. Am I doing the right thing?


Solution

  • I am really not a Lotus Notes Developer. Finally the problem has been resolved for my own case, but it might not be the usual case. I got this Lotus Notes Export job because I am developing a Google App Engine app to replace an old Lotus Notes App and has to migrate the old data.

    What I did: I open up the Notes Designer and add some views. Then I want to export them to a csv file. It turns out that the way I construct the database is not right.

    Dim db As NotesDatabase
    Set db = New NotesDatabase("","app.nsf")
    

    This way, db cannot find the view I recently created.

    Dim db As NotesDatabase
    Dim ss As New NotesSession
    Set db = ss.Currentdatabase
    

    This one, I could get the view I just created.

    I think the reason behind might be that one is looking at local the other is looking at production. The production don't have the changes I made after a certain point.