Solved

Button to open existing document, not compose

Posted on 2008-11-02
7
1,305 Views
Last Modified: 2013-12-18
I have documents with a field "Title".  The contents of this field in all of the documents match the contents of a Title field in a different form.

Specifically, there is a single 'Directions" document that relates to the larger collection of "Report" documents.

I need a button in the "Report" documents that will take the user back to the "Directions" document.

I have

@Command([OpenView]; "Directions"; Title);
@Command([OpenDocument])

where the Directions view lists all of the Directions documents with the title name in the first column.  It works, but it leaves the Directions view open and I don't want that.  It also seems to take a long time to complete the process.

1.  If I go with the @commands, how do I close the view?
2. An alternative would be, I have lotusscript that creates the Report documents - what can I add that might add a doclink back to the directions form?

thanks experts you rock!
0
Comment
Question by:jkee54
7 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 22864762
0
 
LVL 7

Expert Comment

by:olaraak
ID: 22865106
The simplest way to add document link back to directions document, is to add a rich text field to Direction document, named for example "ParentLink", and in form properties box, on second tab, select "Inherit entire selected document into rich text field", pick your field's name and leave type "Link".

There are other ways to accomplish this, using Lotusscript, but this is the easiest one.

When creating a new Direction document, Directions (parent) document must be selected, to show Notes which document you want to link to.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 22867054
>> "If I go with the @commands, how do I close the view?"

I would try loading the view and document into the same frame.  That way you don't need to close the view, the document simply replaces the view in the frame.  To do this, you need to use @SetTargetFrame along with the @Commands that can support it.  [OpenView] supports @SetTargetFrame but [OpenDocument] does not. However, since you are not using any of the optional parameters for [OpenDocument], you can easily switch to [EditDocument] which does support @SetTargetFrame.  For example, if you have a frame named "NotesView" (which is highly recommended by the way), you could try this:

@SetTargetFrame("NotesView");
@Command([OpenView]; "Directions"; Title);
@SetTargetFrame("NotesView");
@Command([EditDocument]; "0")
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22871269
Assuming you have a current document doc, with a field Title:

Dim ws As New NotesUIWorkspace
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim vdoc As NotesDocument
Dim view As NotesView

Set db= ns.CurrentDatabase
Set view= db.GetView("Directions")
Set vdoc= view.GetDocumentByKey(doc.Title, True)
Call ws.EditDocument(false, vdoc)

0
 

Author Comment

by:jkee54
ID: 22892605
sjef,

Gives error, 'variant does not contain an object'
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 22893070
As I said, the code assumes you have a current document in the variable doc. If that's not the case:

Dim ws As New NotesUIWorkspace
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim vdoc As NotesDocument
Dim curdoc As NotesDocument
Dim view As NotesView

Set curdoc= ws.CurrentDocument.Document
Set db= ns.CurrentDatabase
Set view= db.GetView("Directions")
Set vdoc= view.GetDocumentByKey(curdoc.Title, True)
Call ws.EditDocument(false, vdoc)
0
 

Author Comment

by:jkee54
ID: 22898017
Excellent!  Thank you for the extra direction, works perfectly.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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