Solved

Passing arguments when creating a new document

Posted on 2002-04-26
6
179 Views
Last Modified: 2013-12-18
From a document opened, I want a buttom to create a new document in another database on the same server, but I want to have a link to the new document, in order to associate the two documents.  I do prefer to create the new document and have the possibility to edit that new form.  I did try with @Command([compose];), but I do not know how to pass the link. Please assist.
0
Comment
Question by:Enrique040897
  • 4
  • 2
6 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971691
Well, unless you dont save the current document you cannot pass the document link to the other database...
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971710
Hi there !

Try this code. This will save the current Document and create a link in the target database.  You cannot do a link without saving the current document.  Thats why this approach.

Change all the values and just put it under a button.

Good Luck!
Arun.
     
     
     Dim ss As New notessession
     Dim ws As New NotesUIWorkspace    
     Dim uidoc As NotesUIDocument    
     Dim db As NotesDatabase
     Dim tardb As NotesDatabase
     Dim curDoc As NotesDocument
     Dim tarDoc As NotesDocument
     Dim rtitem As NotesRichTextItem
     
     Set db = ss.CurrentDatabase
     Set tardb = New NotesDatabase( ss.CurrentDatabase.Server , "data\am174\webtest.nsf") ' Change the path for new database
     
     Set curDoc = db.CreateDocument
     curDoc.Form = "Test"  'The name of the form that you are composing....
     Call curDoc.Save(True,False)
     
     Set tarDoc = tardb.CreateDocument
     tarDoc.Form = "Test1" ' The form name in the target database
     Set rtitem = New NotesRichTextItem(tardoc , "Body" ) ' Body is the Field that contains the doc link
     Call rtitem.AppendDocLink(curDoc , "Alternate text when moused !" )
     
     Call tarDoc.Save(True , False)
     
     Set uidoc = ws.EditDocument(True , curDoc , False , "" )    
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971818
What i am doing in the code is...

Create a document "A" and save it.
Create a document "B" with doclink in the second database pointing to document "A".
Now open document "A" in edit mode as if you are composing the document.

If you wish to cancel the opened document its not possible now since there is already a document pointing to this one and this one is already saved.

:-(
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:Enrique040897
ID: 6982040
Sorry for the delay. I was not on my workplace. I will let you know. But I want something like this.  Just imagine that you are filling a person record.  Then, you want to add dependant records.  Those records should be linked to the person record.  Then, if I want to open a person record, I can be able to access its dependant records.
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 125 total points
ID: 6983487
       Dim ss As New notessession
     Dim ws As New NotesUIWorkspace    
     Dim uidoc As NotesUIDocument    
     Dim db As NotesDatabase
     Dim tardb As NotesDatabase
     Dim curDoc As NotesDocument
     Dim tarDoc As NotesDocument
     Dim rtitem As NotesRichTextItem
     Dim rtitem2 As NotesRichTextItem
     
     Set db = ss.CurrentDatabase
     Set tardb = New NotesDatabase( ss.CurrentDatabase.Server , "data\am174\webtest.nsf") ' Change the path for new database
     
     Set curDoc = db.CreateDocument
     curDoc.Form = "Test"  'The name of the form that you are composing....
     Set rtitem2 = New NotesRichTextItem(curDoc, "Body")
     Call curDoc.Save(True,False)
     
     Set tarDoc = tardb.CreateDocument
     tarDoc.Form = "Test1" ' The form name in the target database
     Set rtitem = New NotesRichTextItem(tardoc , "Body" ) ' Body is the Field that contains the doc link
     Call rtitem.AppendDocLink(curDoc , "Alternate text when moused !" )
     
     Call tarDoc.Save(True , False)
     
     Call rtitem2.AppendDocLink(tarDoc , "Alternate Text when moused ! ")
     Call curDoc.Save(True,False)
     
     Set uidoc = ws.EditDocument(True , curDoc , False , "" )    

=============

The above code links both the target document to the source and the source to the target.  Both are saved the moment created so that they can be referenced back and forth.

You can set the target document with values so that, when you open that document you will see that it depends on the current document.

Get Back if you have more questions!
Arun.
0
 

Author Comment

by:Enrique040897
ID: 6991865
Arunkumar , could you please modify the script in order to use it from an opened document. (to create a new document from an opened document.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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