[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I set view to current view in this lotus script?

Posted on 2009-04-28
3
Medium Priority
?
2,106 Views
Last Modified: 2013-12-18
I have this code:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As
Variant, Continue As Variant)
      Dim session As New notessession
      Set db = session.currentdatabase
      Set view = db.getview("People")

      Set ProfileDoc = db.getprofiledocument("PickerView")
'     ProfileDoc.Pview = "People"
End Sub
And I want it to work no matter what the current view is.. so not just "People" can I have it work with "current view" ?
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As 
Variant, Continue As Variant) 
      Dim session As New notessession 
      Set db = session.currentdatabase 
      Set view = db.getview("People") 
 
      Set ProfileDoc = db.getprofiledocument("PickerView") 
'     ProfileDoc.Pview = "People" 
End Sub

Open in new window

0
Comment
Question by:Monterey
  • 2
3 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 24257999
The current view? I don't quite understand what you're looking for. Why do you need the current view? But I suppose that you need the following:

Dim ws As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim view As NotesView

Set uiview= ws.CurrentView
Set view= uiview.View

One warning though: I noticed that playing too much with the CurrentView can lead to a crash of the Notes client. Sometimes, there is no current view, for example if you are on the Notes Workspace, no database open, and you type Ctrl-M. Similarly, you can click a database icon once, then click Create and then select one of the forms in the database. Or the database is set to open a form when opened, e.g. an enquiry form.
0
 
LVL 3

Expert Comment

by:tiler
ID: 24442685
When you're in a document, there's no "current view" in the sense sjef is thinking. If you want to know what view the document was opened from, you could use the expression Source.Document.ParentView.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1000 total points
ID: 24446516
That's what I implied with my last paragraph. The current view may be hidden beneath a document, but AFAIK it's still the current view, the topmost view. If a document is open in the UI, that document may not even be from the current view, if the user switched panes using one or more Ctrl-Tabs. I'll check tomorrow whether there's a current view if a document is open in the UI.

By the way, according to the Help database, it says on the ParentView property:
"If the document was retrieved directly from a database or a document collection, the ParentView property returns Nothing."
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question