Solved

Button to open existing document, not compose

Posted on 2008-11-02
7
1,298 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

919 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

14 Experts available now in Live!

Get 1:1 Help Now