Solved

Button to open existing document, not compose

Posted on 2008-11-02
7
1,300 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LOtus Notes 6.5 low performance 13 36
Lotus notes email code 2 122
All incoming messages are coming as read 3 38
@Mailsend 3 58
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…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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