Lookup the last document accessed in a view

That’s a easy one folks… but I just can’t get it to work… I need to do a lookup in a view, for the last created document… I am not sure how to right the formula with this condition…

I’d be glad if someone could give any idea…

Thanks in advance.

Subject: Will this help?

Dim session As New Notessession Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase 

Dim view As NotesView

Dim doc As NotesDocument



Set db = session.CurrentDatabase

Set view = db.GetView("Plans")



On Error Resume Next	

Set doc = view.GetLastDocument



'ws.OpenDatabase "","","Plans"

ws.EditDocument True, doc

Subject: Lookup the last document accessed in a view

Howdy! :wink:

If you are using command language, 1st create the view that Sam mentioned. Then try this:

list := @DbColumn(“”:“NoCache”; “”; view; 1);

@Subset(list;1)

You can change the “1” to any column in Sam’s view in order to return a value.

Good luck!

Steve in Montreal ~8D

“Wherever you go, there you are.”

Subject: RE: Lookup the last document accessed in a view

Thanks a lot guys… It worked very well…

Subject: Lookup the last document accessed in a view

Sort your view (or a hidden view) by Creation Date (descending) and grab the 1st document if the view.

Subject: RE: Lookup the last document accessed in a view

Right… I’ve tried to do that, but I don’t how to specify the key for the lookup… How do I make it choose the first document in the view? I was trying to use @modified or @created… I am not sure if Iam going in the right direction…