Solved

Button to open existing document, not compose

Posted on 2008-11-02
7
1,295 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
Comment Utility
0
 
LVL 7

Expert Comment

by:olaraak
Comment Utility
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
Comment Utility
>> "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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
Comment Utility
sjef,

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

Accepted Solution

by:
Sjef Bosman earned 250 total points
Comment Utility
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
Comment Utility
Excellent!  Thank you for the extra direction, works perfectly.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now